# Publishing

A guide has a draft and, once it is on sale, a live version buyers see. Edits always go to the draft. Buyers keep the live version until the changes are published.

## What stays in the studio

- A guide's **first publish** (putting a draft on sale).
- **Publishing the sales page.** [save_sales_page_draft](https://developers.sceniq.earth/reference/save_sales_page_draft.md) only saves the draft.
- Store visibility, archiving a guide and the creator agreement.

## Publishing a live guide's changes

With a key that has the publish option ([scopes](https://developers.sceniq.earth/get-started/keys-and-scopes.md)), an agent can publish the changes of a guide that is already on sale, under these rules:

1. **Only when the creator asks.** Never on your own initiative, never as a side effect of finishing a task.
2. **Check first.** [get_publish_status](https://developers.sceniq.earth/reference/get_publish_status.md): go ahead only when `live` is true, `hasUnpublishedChanges` is true, `pendingSince` is null and `blocking` is empty.
3. **Publish once.** [publish_changes](https://developers.sceniq.earth/reference/publish_changes.md) queues the same build as the studio's Publish changes button and returns the queued state.
4. **Poll.** Call [get_publish_status](https://developers.sceniq.earth/reference/get_publish_status.md) every few seconds until `pendingSince` is null and `published.version` went up, usually within seconds. Then tell the creator which version is live.

## Refusals

| Code | Means |
|---|---|
| `api_scope_required` | The key has no publish option. |
| `not_live` | The guide is a draft or archived; its first publish is the creator's. |
| `no_changes` | Buyers already see every change. |
| `not_publishable` | A publish gate is open; `details.blocking` lists each one. |

While a build runs, calling [publish_changes](https://developers.sceniq.earth/reference/publish_changes.md) again queues nothing (`queued: false`), so a retry never publishes the same content twice.
