Create prompt

http
POST /projects/{project_reference}/prompts

Create a prompt source file in the project source or a preview branch so agents and clients can reuse its text; returns the prompt source document. Requires project.agents.write.

Parameters

NameInRequiredDescription
project_referencepathYesProject slug, UUID, or domain that identifies the project.
source_target_kindqueryWhere to write the prompt file: project (the default) or preview_branch. Other values are rejected.
target_branch_idqueryPreview branch to use. Required for the preview_branch target; rejected for any other target.

Request body

FieldTypeRequiredDescription
idstringYesPrompt id, also the name of its source file.
descriptionstring,nullPrompt description. Omit it or send null for none.
contentstringYesPrompt text.
sourcestringComplete prompt source file. It must export a structured prompt whose id matches id; when omitted the file is generated from description and content.

Responses

StatusDescription
201Created prompt document
400Bad request
401Unauthorized
403Forbidden
409Conflict