Workflows
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 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), an agent can publish the changes of a guide that is already on sale, under these rules:
- Only when the creator asks. Never on your own initiative, never as a side effect of finishing a task.
- Check first. get_publish_status: go ahead only when
liveis true,hasUnpublishedChangesis true,pendingSinceis null andblockingis empty. - Publish once. publish_changes queues the same build as the studio's Publish changes button and returns the queued state.
- Poll. Call get_publish_status every few seconds until
pendingSinceis null andpublished.versionwent 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 again queues nothing (queued: false), so a retry never publishes the same content twice.