Prompt templates
Partner-owned, versioned prompts you write once and roll out to many workspaces.
A prompt template is a reusable prompt owned by your company (the partner) — it lives above accounts and organizations. You write the prompt once, with {{placeholders}} for the parts that differ per customer, publish it as an immutable version, and assign that version to any workspace under your key. Each workspace supplies its own variable values, and the prompt is rendered from the template at request time. To roll out a change, create and publish a new version, then assign it to the workspaces that should use it.
Because templates are partner-level, the template routes take no X-Account-Id header — the API key alone identifies the owner. The assignment routes act on a workspace, so those keep the header as usual.
Templates and versions
A template is a named container; the content lives in its versions:
A chat template drives a workspace’s base system prompt (what chat.prompt does manually); a voice template drives the voice assistant’s spoken prompt and its first message (what voice.prompt / voice.firstMessage do manually). See the two prompts for what each governs.
Version lifecycle
How versions move through it:
- Creating a template (
POST /v1/prompt-templates) creates version 1 as a draft in the same call. - A template holds at most one draft at a time. Creating another while a draft exists returns
409with the existingdraftVersionId— edit or publish that draft instead. POST /v1/prompt-template-versions/{versionId}/publishmakes a draft live. Publishing validates the version (see below).- To iterate on a published prompt, create the next version:
POST /v1/prompt-templates/{templateId}/versionsduplicates the latest published version (or an explicitsourceVersionId, which may be published or archived) into a new draft. Version numbers are assigned automatically. POST /v1/prompt-template-versions/{versionId}/archiveretires a published version. Archived versions cannot be restored, but they can still be duplicated into a new draft.
Workspaces are pinned to a specific version, never “latest” — publishing a new version changes nothing until you re-assign workspaces to it, so rollouts are explicit and roll back by re-pinning the previous version.
Variables
Placeholders use double braces — {{company}} — and every placeholder must be backed by a variable definition on the version:
Publishing enforces three rules, so a published version always renders completely:
- The
promptis not empty. - Every
{{placeholder}}used in the prompt orfirstMessagehas a variable definition. - Every variable is either
requiredor has adefaultValue— an optional variable with no default could otherwise render as an empty string mid-sentence.
Template placeholders are written without spaces ({{company}}) and are rendered server-side when the workspace’s prompt is built. They are unrelated to the Liquid aliases of tools, which are written with spaces ({{ orderStatus }}) and are substituted live during the conversation — a template can contain both.
Assigning a version to a workspace
A workspace has one template slot per channel — chat and voice:
- Only published versions can be pinned (and the version’s template
typemust match the slot). The suppliedvariablesare validated against the version’s definitions — every required variable needs a value, and types/validationconstraints are checked. - While a template is assigned, it wins over the manual prompt: the workspace’s
chat.prompt(orvoice.prompt/voice.firstMessage) becomes the fallback used only after you unassign. The manual fields keep their stored values and stay editable throughout. - The workspace detail and the voice integration read back
promptSource(templateormanual) and apromptTemplateobject per channel describing the pinned version and values. Add?includeRendered=truetoGET /v1/workspaces/{workspaceId}or the voice integration GET to also receive the fully renderedrenderedPrompt/renderedFirstMessage. - A voice template can be assigned before the workspace has a voice integration; it lies dormant and takes effect as soon as the integration is created.
A template cannot be deleted while any workspace is pinned to one of its versions — unassign everywhere first.
Template tools
A version can reference partner tools — tools owned by your company rather than by one organization (GET/POST /v1/tools, no X-Account-Id). Assigning the version to a workspace brings those tools along:
- A workspace’s effective tool set is the union of its directly attached tools and the pinned versions’ tools. Inspect it with
GET /v1/workspaces/{workspaceId}/tools/effective(optionally?mode=chat|voice), which also reports any name shadowing — on a name collision, a directly attached tool overrides a template-provided one. - To keep published versions dependable, a tool referenced by a published version (or by an archived version still pinned somewhere) cannot be renamed or deleted — but its URL, headers, and schemas stay editable, so rotating a credential never requires republishing.

