> ## Documentation Index
> Fetch the complete documentation index at: https://docs.upliftai.org/llms.txt
> Use this file to discover all available pages before exploring further.

# Draft and publish

You edit a **draft**. Callers hear what you **publish**. Change the prompt freely, call it yourself, and publish when it's ready.

## What happens when you publish

Until your first publish, nothing is split: **prod is the draft**, so every save goes live.

Your first publish takes a **numbered snapshot** and points **prod** at it. From then on a save, in the portal or over the API, only changes the draft. Publish again and prod moves to the new number.

```mermaid theme={null}
flowchart LR
  E[Your edits] --> D[Draft]
  T[Your test calls] -.-> D
  D -->|publish| P["Prod (v12)"]
  P --> I[Inbound calls]
  P --> O[Outbound calls and campaigns]
```

**Inbound calls, share links and embeds always run prod.** Outbound calls, web sessions and campaigns run prod too, unless you pick another version.

I recommend publishing once before you put the assistant on a campaign or a [share link](/voice-agents/getting-started/quickstart-web). After that, your edits stay off real calls until you decide otherwise.

## Try the draft before anyone else hears it

In the portal, **Test in Browser** and **Test by Phone** run the draft. Unsaved edits are saved first.

Over the API, pass `assistantVersion: "draft"` on a [call](/api-reference/starting-a-conversation/dispatch-a-call-from-this-assistant) or a [web session](/api-reference/starting-a-conversation/create-a-web-session-token). The session and every call webhook carry `assistantAlias`, which reads `draft` on a test call — see [session details](/voice-agents/calling/session-details).

## Publish it

In the portal, open the **⋯** menu, click **Publish Agent**, and write a short release summary. **Version History** shows the versions you published before. Publish takes the **last saved** draft.

Over the API, [publish](/api-reference/assistants/publish-an-assistant-version) with `version: "draft"` and an optional message:

```bash theme={null}
curl -X POST https://api.upliftai.org/v1/realtime-assistants/$ASSISTANT_ID/publish \
  -H "Authorization: Bearer $UPLIFT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "version": "draft", "message": "Shorter greeting, asks for the order number first" }'
```

## Go back to an older version

Publish an older number, for example `"version": 11`. **Prod moves back** and the draft stays as it is. Rollback is API only for now.

## Hold a call on one version

Pass `assistantVersion: 12` on a call, or set `config.assistantVersion` on a campaign, and it's **pinned**: it stays on that version while prod moves on.

Campaigns **follow prod** by default, so a publish reaches them on their next dial — see [campaigns](/voice-agents/campaigns/getting-started).

## The edge cases we already handle

* **A prod or pinned call keeps the version it started on.** Prompt, tools and scorecard all come from that version. Publishing mid-call changes nothing on that call. Campaign calls grade with the campaign's own scorecard.
* **Public and private follow the published version.** Once you've published, turning a share link public or private needs a publish. Before the first publish a save is enough.
* **A fresh publish can take a moment to reach every region.** A launch on prod may return a 503 in that window, so retry. Campaigns wait it out on their own.

## Tech details for techies

* [Get the assistant](/api-reference/assistants/get-an-assistant) returns the draft. Add `?version=prod` or a number to read a published one.
* The [versions list](/api-reference/assistants/list-published-versions) and the [publish state](/api-reference/assistants/get-an-assistants-publish-state) show where draft and prod point.
* A publish **409** means the assistant was changing, so retry. A **404** means a number that was never published.
* A rollback's message isn't stored.
* `?assistantAlias=draft` on the [sessions list](/api-reference/sessions-%26-call-records/list-an-assistants-sessions) finds your test calls.
