VocalDocscontracts 1.65.0

Activate a Prompt template version

POST /v1/prompt-templates/{prompt_template_id}/versions/{version}/activate

PropertyValue
Operationactivate_prompt_template_version
GroupPrompt templates
Scopeprompts:write
Route classcontrol
IdempotencyIdempotency-Key accepted: a retry with the same key replays the first answer
AuditAudited prompts.version.activate (mutation)
Released in1.55.0
Phase 0 hostServed (the hosted api pins 1.65.0)

Makes the version the active one and answers it (1.55.0). For an Agent layer it is the version the next Agent publish pins when its prompt names none; for an Organization layer it reaches the next dispatched Call of every Agent that receives the layer, and Calls in progress keep the version they resolved. Activating an older version is the rollback. A write to an Organization layer also needs prompts:admin and is otherwise refused with forbidden and the detail prompts_admin_required.

Request

Set VOCAL_API to the base URL of your API and VOCAL_API_KEY to an API key with the prompts:write 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_.../versions/1/activate" \
  -H "Authorization: Bearer $VOCAL_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)"

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.
versionpathintegeryesA version number, from 1.
idempotency-keyheaderstringnoA client-chosen key, kept 24 hours per Organization, environment and route. A replay returns the stored response.

Responses

StatusContent typeShapeError codes
200application/jsonPromptTemplateVersion
400application/jsonErrorEnvelopeinvalid_request
401application/jsonErrorEnvelopeunauthenticated
403application/jsonErrorEnvelopeforbidden, org_suspended
404application/jsonErrorEnvelopenot_found
409application/jsonErrorEnvelopeprompt_template_archived, idempotency_in_progress, idempotency_key_reused
429application/jsonErrorEnveloperate_limited
500application/jsonErrorEnvelopeinternal_error

Fields of the 200 answer

The shape is PromptTemplateVersion.

FieldTypeRequiredDescription
acknowledged_warningsarray of PromptLintCodeyesThe warning codes the publisher acknowledges (1.55.0): each warning that needs an acknowledgement (PROMPT_ACKNOWLEDGE_CODES) must be listed, and the Audit event of the publish records the list. A code listed without a finding is kept and has no effect.
activebooleanyesTrue for the active version: the one an Agent publish pins when its prompt names none, or, for an Organization layer, the one dispatch resolves.
allow_termsarray of PromptAllowTermyesStaff and place names that phi_literal does not report (1.55.0), at most 100 of at most 100 characters.
constantsPromptConstantsyes
content_sha256stringyesThe SHA-256 of the canonical variants, declarations and constants, in lowercase hex.
declarationsPromptDeclarationsyes
include_organization_layerbooleanyes
layerPromptLayeryes
lintarray of PromptLintFindingyesThe warnings the publish lint returned (1.55.0); a version holds no error finding, because an error refuses the publish.
max_rendered_tokensintegeryesThe longest render of any variant the declared bounds allow, estimated at 4 characters a token (a target until each model family's tokenizer is measured); checked at publish against the smallest context window of the chain (length_exceeded).
notesstring or nullyes
object"prompt_template_version"yes
prompt_template_idPromptTemplateIdyes
published_atTimestampyes
published_byActorRefyes
purposePromptPurposeyes
source_revisionintegeryesThe draft revision this version was published from.
statusPromptTemplateVersionStatusyes
variantsPromptVariantsyes
versionintegeryesThe snapshot number, from 1.