POST
/v2/projects/{projectId}/promptsCreate a project prompt
Creates a prompt configuration for a project. Supply name and providerName; you can also provide a template and select basicPromptOptions to include supported prompt context. The response includes the created prompt and its identifier.
- IdempotentThe SDK sends
Idempotency-Key, so a retried request is only applied once.
projectIdintegerrequired
The integer identifier of the project in which to create the prompt.
Prompt configuration to create. name and providerName are required.
basicPromptOptionsarray<string>optional
Prompt context options to include: KEY_NAME, KEY_DESCRIPTION, KEY_CONTEXT, PROJECT_DESCRIPTION, LANGUAGE_NOTES, TM_SUGGESTIONS, SCREENSHOT, or GLOSSARY.
namestringrequired
The name of the prompt.
providerNamestringrequired
The name of the provider to use.
templatestringoptional
The prompt template.
200Returns the created prompt, including its `id`, `name`, `projectId`, and `providerName`, with any supplied template and basic prompt options.
basicPromptOptionsarray<string>optional
idintegerrequired
namestringrequired
projectIdintegerrequired
providerNamestringrequired
templatestringoptional
400Bad Request
codestringrequired
paramsarray<object>optional
401Unauthorized
codestringrequired
paramsarray<object>optional
403Forbidden
codestringrequired
paramsarray<object>optional
404Not Found
codestringrequired
paramsarray<object>optional
Error handling
A 400 is returned when required fields are missing or a value is invalid; name and providerName are required, and each basicPromptOptions value must be one of the supported options. A 401 is returned when the request is unauthenticated, and a 403 is returned when the authenticated user cannot create prompts for the project. A 404 is returned when the project cannot be found; the projectId path parameter must identify the project.