The three states
Draft
Your live working copy. Every edit — knowledge, skills, guardrails, playbooks — changes the draft. It is never billed and never frozen.
Published
A frozen snapshot of the draft, taken at publish time. Phone calls and chat sessions serve the last published version, not your draft.
Sandbox
A way to run the draft on demand — the tester and
draftMode: true chat sessions compile the draft ephemerally so you can try changes before they go live.How traffic is routed
- The tester runs the draft. It compiles your current draft on the fly, so it always reflects your latest unsaved-to-live changes.
- Phone & chat serve the last published version. Until you publish, callers and the public chat endpoint keep getting the old behavior.
- Publishing freezes a version. A publish takes your draft, compiles it, and stores it as an immutable, numbered version. That snapshot is what goes live.
- Rollback restores a version. If a new publish misbehaves, repoint “published” at any earlier version — no re-editing required.
Why your first live call returns 409
A chat session (and any non-draft channel) needs a published version to serve. If an agent has never been published, a non-draft chat session responds409 with the problem code no_published_version. The fix is always the same: publish first.
A clean release flow
Review what will change
Pull the pre-publish diff and report to see exactly what is about to go live.
In the API
| Action | Endpoint | Scope |
|---|---|---|
| Publish (freeze a version) | POST /agents/{id}/publish | agents:write |
| Roll back to a version | POST /agents/{id}/rollback | agents:write |
| List version history | GET /agents/{id}/versions | agents:read |
| Pre-publish what-changed diff | GET /agents/{id}/versions/{versionId}/diff | agents:read |
| Pre-publish report | GET /agents/{id}/prepublish-report | agents:read |