Prompts
Prompts API
Create, read, update, and render versioned prompt templates.
POST
/api/promptsCreate a new prompt template.
jsonRequest Body
{
"namespace": "support",
"slug": "ticket-classifier",
"content": "Classify this ticket: {{ticket_text}}\nCategories: {{categories}}"
}Returns the created prompt with version: 1.
GET
/api/promptsList all prompts. Filter by namespace with ?namespace=.
GET
/api/prompts/:namespace/:slugGet a specific prompt. Pass ?version=N for a specific version.
PUT
/api/prompts/:namespace/:slugUpdate a prompt. Creates a new version; previous versions are preserved.
jsonRequest Body
{
"content": "Updated template: {{ticket_text}}"
}GET
/api/prompts/:namespace/:slug/versionsList all versions of a prompt.
POST
/api/prompts/:namespace/:slug/renderRender a prompt template with variables.
jsonRequest Body
{
"variables": {
"ticket_text": "I can't access my account",
"categories": "billing, technical, account"
}
}jsonResponse
{
"rendered": "Classify this ticket: I can't access my account\nCategories: billing, technical, account"
}