Publish a prompt version
/v1/prompts/{slug}/versions/{versionNumber}/publishPublish a prompt version.
Makes this version the prompt's PUBLISHED version; the one published before it becomes ARCHIVED. Labels in the body are pointed at this version. The body is optional. Requires an admin of the prompt's workspace, or an organization admin.
Errors: 404 when the prompt or version does not exist; 409 when the version is ARCHIVED.
Authorization
AuthorizationBearer va_A platform API key (
va_...), created under Settings > API keys. Scoped to an organization or one workspace, with an admin or member role. Used by the management API.
Path parameters
slugstringrequiredthe prompt's slug
versionNumberinteger<int32>requiredthe version to publish
Query parameters
organizationstringrequiredslug of the organization that owns it
Request body application/json
optional labels to point at the version
labelsstring[]Labels to point at the published version, for example
["production"]. Each one is created, or moved from the version it pointed at. Omitted or empty: no label changes.
Responses
idstringThe version's unique id (UUID).
prompt_idstringId (UUID) of the prompt the version belongs to.
version_numberinteger<int32>The version's number within the prompt, from 1, incremented by every save or rollback.
messagesobject[]The template messages, in order. A message's
contentmay contain{{name}} placeholders.Child attributes
roleenum<string>requiredWho the message is from:
system,user,assistantortool(required).One of
"system","user","assistant","tool"contentstringrequiredThe message text (required). Each
{{name}} placeholder is replaced with the value of variablenamewhen the prompt is rendered or run; a placeholder with no value is left as written.
modelstringThe model completions use, for example
gpt-4o. Null when none was set: a completion or test run must then sendmodel_override.temperaturenumber<double>Sampling temperature sent with every completion of this version. Null when not set (the provider's default applies).
max_tokensinteger<int32>Maximum number of tokens to generate, sent with every completion of this version. Null when not set.
top_pnumber<double>Nucleus-sampling value (
top_p) sent with every completion of this version. Null when not set.stopstring[]Stop sequences sent with every completion of this version. Null or empty when none.
variablesobject[]The variables the template declares. Descriptive only: rendering substitutes whichever variables a request sends.
Child attributes
namestringrequiredThe variable's name, as written in
{{name}} (required).descriptionstringWhat the variable is for. Null when not given.
default_valuestringA suggested value. Informational: it is not substituted when a request leaves the variable out.
requiredbooleanWhether callers are expected to supply the variable. Informational, not enforced. Default
false.
toolsobject[]Tool definitions stored with the version. They are stored and returned, but completions of this prompt do not send them to the model.
Child attributes
typestringrequiredThe tool type:
function(required).functionobjectrequiredThe function of a stored tool definition, in OpenAI's function-calling format.
Child attributes
namestringrequiredThe function's name (required).
descriptionstringWhat the function does, for the model. Null when not given.
parametersmap<string, object>The function's parameters as a JSON Schema object. Null when not given.
statusenum<string>Lifecycle state:
DRAFT(saved, never published),PUBLISHED(the prompt's published version; at most one at a time) orARCHIVED(was the published version until another version was published).One of
"DRAFT","PUBLISHED","ARCHIVED"labelsstring[]Labels currently pointing at this version, for example
production. Empty when none.created_atstring<date-time>When the version was saved (ISO 8601).
created_bystringIdentifier of the caller (user or API key) that saved the version, or
unknownwhen the caller could not be identified.