VocalDocscontracts 1.65.0

Dry-run render a Prompt template

POST /v1/prompt-templates/{prompt_template_id}/render

PropertyValue
Operationrender_prompt_template
GroupPrompt templates
Scopeprompts:read
Route classread
IdempotencyIdempotency-Key accepted: a retry with the same key replays the first answer
AuditNot audited: A dry run: it changes no state and reads no Call content, so it writes no Audit event (ADR 0012, prompt-manager.md section 7).
Released in1.55.0
Phase 0 hostServed (the hosted api pins 1.65.0)

Renders the draft, or a version, for one variant with the synthetic variables, slots, state, Call fields, constants and retrieval outcomes of the body, and answers its section with a token estimate, the stable prefix, the names of missing values and the lint findings (1.55.0). A body that does not parse is 422 validation_failed with template_invalid; a value of the wrong type is variable_type. It writes nothing: no Call, Audit or Usage event.

Request

Set VOCAL_API to the base URL of your API and VOCAL_API_KEY to an API key with the prompts:read scope (Authentication and keys). Replace each placeholder, such as agt_... or <name>, with your own value.

curl -X POST "$VOCAL_API/v1/prompt-templates/ptpl_.../render" \
  -H "Authorization: Bearer $VOCAL_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{}'

Parameters

NameInTypeRequiredDescription
prompt_template_idpathPromptTemplateIdyesThe id of a Prompt template: ptpl_ and the row's UUIDv7 in 26 Crockford base32 characters. Opaque and safe to log.
idempotency-keyheaderstringnoA client-chosen key, kept 24 hours per Organization, environment and route. A replay returns the stored response.

Request body

Content type application/json, required: PromptTemplateRenderRequest.

FieldTypeRequiredDescription
callPromptRenderCallInputno
constantsmap of PromptConstantValuenoOrganization constants for this render; those of the Organization layer the render resolves when omitted. display_name is the Organization name.
retrievalmap of booleannoWhether each Knowledge binding returned passages for this request, by handle: true renders the first branch of its retrieval slot, false or absent the second.
slotsmap of PromptSlotValuenoSynthetic slot values; an unset slot renders empty or its default().
statestringnoThe active state, the state root.
time_nowRequestTimestampnoThe time.now root; the request instant when omitted.
variablesmap of VariableValuenoSynthetic values of the declared variables. A value of an undeclared name is variable_unknown, of the wrong type variable_type; an optional variable without a value renders empty and is named in missing_values.
variantPromptVariantKeynoThe variant to render; default when omitted, and default for a key the template lacks.
versionintegernoThe version to render; the draft when omitted.

Responses

StatusContent typeShapeError codes
200application/jsonPromptRenderResult
400application/jsonErrorEnvelopeinvalid_request
401application/jsonErrorEnvelopeunauthenticated
403application/jsonErrorEnvelopeforbidden
404application/jsonErrorEnvelopenot_found
409application/jsonErrorEnvelopeidempotency_in_progress, idempotency_key_reused
422application/jsonErrorEnvelopevalidation_failed
429application/jsonErrorEnveloperate_limited
500application/jsonErrorEnvelopeinternal_error

Fields of the 200 answer

The shape is PromptRenderResult.

FieldTypeRequiredDescription
lintarray of PromptLintFindingyesThe lint findings of what was rendered: the stored findings of a version, those of the draft, and for an Agent version the cross-checks of its publish.
missing_valuesarray of PromptValuePathyesThe paths that rendered empty for want of a value, such as variables.clinician_name (missing_value); names only, never a value.
object"prompt_render"yes
sectionsarray of PromptRenderSectionyesIn composition order.
stable_prefix_tokensintegeryesThe tokens before the first per-Call or per-Turn value, which a Provider that caches prompts may reuse between requests (prompt-manager.md section 4).
total_tokensintegeryes
variantPromptVariantKeyyes