Skip to content

Prompt Templates

List Prompt Templates

List prompt templates for the organization.

Omit limit to get every template; total is the full count either way.

Parameters

NameInTypeRequiredDescription
limitqueryintegernoMax rows to return (1-100). Omit to return every row.
offsetqueryintegernoRows to skip — pass the previous response’s next_offset.
org_idpathstring (uuid)yes
project_idquerystringnoFilter by project id, or ‘none’ for uncategorized templates.

Responses

StatusDescriptionBody
200Successful ResponsePage_PromptTemplateResponse_
422Validation ErrorHTTPValidationError

Create Prompt Template

Create a new prompt template. Requires admin/owner role.

fields (optional) defines an extraction schema — when present, the template runs as structured extraction instead of free-text generation.

Parameters

NameInTypeRequiredDescription
org_idpathstring (uuid)yes

Request body (required)

FieldTypeRequiredDescription
descriptionstringno
fieldsPromptFieldSchema[]no
file_input_mode"auto" | "image" | "text" | "both"no
modelstringno
namestringyes
post_processing_instructionsstringno
providerstringno
reasoning_effortstringno
tagsstring[]no
textstringno

Responses

StatusDescriptionBody
201Successful ResponsePromptTemplateResponse
422Validation ErrorHTTPValidationError

GET /api/orgs/{org_id}/prompt-templates/{id_or_slug}

Section titled “GET /api/orgs/{org_id}/prompt-templates/{id_or_slug}”

Get Prompt Template

Get a prompt template by ID or slug.

Parameters

NameInTypeRequiredDescription
id_or_slugpathstringyes
org_idpathstring (uuid)yes

Responses

StatusDescriptionBody
200Successful ResponsePromptTemplateResponse
422Validation ErrorHTTPValidationError

POST /api/orgs/{org_id}/prompt-templates/{id_or_slug}/test

Section titled “POST /api/orgs/{org_id}/prompt-templates/{id_or_slug}/test”

Test Prompt Template

Stream a test execution of a prompt template. Requires admin/owner role.

Drives BOTH modes via the unified stream_prompt_test runner: a plain prompt (no fields on the active revision) streams free-text token/done events; a schema-bearing prompt streams the structured extracting/result/post_processing/done events and requires material input via input_text or input_url.

Parameters

NameInTypeRequiredDescription
id_or_slugpathstringyes
org_idpathstring (uuid)yes

Request body (required)

FieldTypeRequiredDescription
attachmentsPromptTestAttachment[]no
file_input_mode"auto" | "image" | "text" | "both"no
input_textstringno
input_urlstringno
modelstringyes
providerstringyes
reasoning_effortstringno
variablesobjectno

Responses

StatusDescriptionBody
200Successful Responseobject
422Validation ErrorHTTPValidationError

PUT /api/orgs/{org_id}/prompt-templates/{template_id}

Section titled “PUT /api/orgs/{org_id}/prompt-templates/{template_id}”

Update Prompt Template

Update a prompt template by ID or slug. Requires admin/owner role.

Passing text, fields, or post_processing_instructions creates a new revision (versioned together as one snapshot).

Parameters

NameInTypeRequiredDescription
org_idpathstring (uuid)yes
template_idpathstringyes

Request body (required)

FieldTypeRequiredDescription
descriptionstringyes
fieldsPromptFieldSchema[]no
file_input_mode"auto" | "image" | "text" | "both"yes
modelstringyes
namestringno
post_processing_instructionsstringno
providerstringyes
reasoning_effortstringyes
tagsstring[]no
textstringno

Responses

StatusDescriptionBody
200Successful ResponsePromptTemplateResponse
422Validation ErrorHTTPValidationError

DELETE /api/orgs/{org_id}/prompt-templates/{template_id}

Section titled “DELETE /api/orgs/{org_id}/prompt-templates/{template_id}”

Delete Prompt Template

Soft-delete a prompt template by ID or slug. Requires admin/owner role.

Parameters

NameInTypeRequiredDescription
org_idpathstring (uuid)yes
template_idpathstringyes

Responses

StatusDescriptionBody
204Successful Response
422Validation ErrorHTTPValidationError

GET /api/orgs/{org_id}/prompt-templates/{template_id}/revisions

Section titled “GET /api/orgs/{org_id}/prompt-templates/{template_id}/revisions”

List Prompt Template Revisions

List all revisions for a prompt template (by ID or slug).

Parameters

NameInTypeRequiredDescription
org_idpathstring (uuid)yes
template_idpathstringyes

Responses

StatusDescriptionBody
200Successful ResponsePromptTemplateRevisionSummary[]
422Validation ErrorHTTPValidationError

GET /api/orgs/{org_id}/prompt-templates/{template_id}/runs

Section titled “GET /api/orgs/{org_id}/prompt-templates/{template_id}/runs”

List Prompt Template Runs

List runs for a prompt template (by ID or slug).

Parameters

NameInTypeRequiredDescription
limitqueryintegerno
offsetqueryintegerno
org_idpathstring (uuid)yes
template_idpathstringyes

Responses

StatusDescriptionBody
200Successful ResponsePromptTemplateRunResponse[]
422Validation ErrorHTTPValidationError