Create a prompt version
POST /dashboard/prompts/
Creates a new prompt template version. The combination of name and version must be unique per user. Returns 409 if that version already exists for this prompt name.
Request body
string
required
Prompt name used to group versions together (e.g.
"classify-intent").number
default:"1"
Integer version number. Increment this with each iteration of the prompt.
string
required
The full prompt text at this version.
string
Optional human-readable description of what changed in this version.
Response — 201
string
UUID of the new prompt template record.
string
Prompt name.
number
Version number.
string
The full prompt text.
string | null
Description of this version.
boolean
Whether this version is active. Always
true on creation.string
ISO 8601 creation timestamp.
Example response
List all prompt versions
GET /dashboard/prompts/
Returns all prompt template versions for the authenticated user, ordered by name then version descending (newest version first within each name).
Response — 200
An array of prompt template objects. Each object has the same fields as the create response.List versions of a named prompt
GET /dashboard/prompts/{name}/versions
Returns all versions of a named prompt ordered newest-first. Returns 404 if no prompt with this name exists for the authenticated user.
Path parameters
string
required
The prompt name (e.g.
"classify-intent").Response — 200
An array of prompt template objects for this prompt name.Compare versions
GET /dashboard/prompts/{name}/compare
Returns per-version analytics for a named prompt. Metrics are computed from all traces linked to each version via the record usage endpoint. Returns 404 if the prompt name does not exist for the authenticated user.
Path parameters
string
required
The prompt name to compare versions for.
Response — 200
string
Prompt name.
object[]
Per-version analytics, one entry per version.
Example response
Record prompt usage
POST /dashboard/prompts/usage
Records that a specific trace used a prompt template version. Call this after a trace completes to link it to the prompt used. This link powers the per-version analytics in the compare endpoint. The call is idempotent — calling it multiple times with the same arguments is safe.
Request body
string
required
Name of the prompt template that was used.
number
required
Version number of the prompt that was used.
string
required
UUID of the trace that used this prompt version.
string
UUID of the specific span within the trace where this prompt was used. Optional but recommended for multi-prompt traces.
Response — 201
string
Always
"recorded" on success.