Workflows

Publishing

Markdown

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:

  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: go ahead only when live is true, hasUnpublishedChanges is true, pendingSince is null and blocking is empty.
  3. Publish once. publish_changes queues the same build as the studio's Publish changes button and returns the queued state.
  4. Poll. Call get_publish_status every few seconds until pendingSince is null and published.version went up, usually within seconds. Then tell the creator which version is live.

Refusals

CodeMeans
api_scope_requiredThe key has no publish option.
not_liveThe guide is a draft or archived; its first publish is the creator's.
no_changesBuyers already see every change.
not_publishableA 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.