POST/v2/projects/{projectId}/prompts

Create 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.

1 parameter · 4 body fields
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.

5 status codes
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
Allowed:unauthenticatedapi_access_forbiddenapi_key_not_foundinvalid_api_keyinvalid_project_api_keyproject_api_key_expiredbad_credentialsmfa_enabledinvalid_otp_codemfa_not_enabledcan_not_revoke_own_permissionsdata_corrupted
paramsarray<object>optional
401Unauthorized
codestringrequired
Allowed:unauthenticatedapi_access_forbiddenapi_key_not_foundinvalid_api_keyinvalid_project_api_keyproject_api_key_expiredbad_credentialsmfa_enabledinvalid_otp_codemfa_not_enabledcan_not_revoke_own_permissionsdata_corrupted
paramsarray<object>optional
403Forbidden
codestringrequired
Allowed:unauthenticatedapi_access_forbiddenapi_key_not_foundinvalid_api_keyinvalid_project_api_keyproject_api_key_expiredbad_credentialsmfa_enabledinvalid_otp_codemfa_not_enabledcan_not_revoke_own_permissionsdata_corrupted
paramsarray<object>optional
404Not Found
codestringrequired
Allowed:unauthenticatedapi_access_forbiddenapi_key_not_foundinvalid_api_keyinvalid_project_api_keyproject_api_key_expiredbad_credentialsmfa_enabledinvalid_otp_codemfa_not_enabledcan_not_revoke_own_permissionsdata_corrupted
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.