Publish and unpublish records, hold changes back in a draft, schedule both, and read only published content from your site.
Records start unpublished. A record is live when it has a published_at, and what is live is its current content: an edit to a published record reaches your site at once. To hold changes back until they are ready, put them in a draft.
In the web app, open a record and choose Publish or Unpublish. Through the API, publishing is the record’s publication:
curl -X POST "https://api.nohead.io/v1/records/rec_01J9ZQ3F8X/publication" \ -H "Authorization: Bearer $NOHEAD_API_KEY"
DELETE on the same URL unpublishes, and GET says since when the record is live, the live revision and who published it (404 with detail code not_published for a record that isn’t live).
Each is a publish or unpublish revision in the record’s history, and takes a change note and If-Match like any record write. Publishing a published record, or unpublishing an unpublished one, changes nothing. Unpublishing keeps the content, and publishing again sets a new published_at.To publish or unpublish up to 100 records at once, POST /v1/collections/{collection_id}/record-batches with action: "publish" or "unpublish" and their record_ids. Each record is changed as if by its own request, and one that fails doesn’t stop the others.In the web app, Editors and every role above can publish; Viewers can’t. API keys publish with records:write.
A draft holds changes to a record until they are merged into it, while the record keeps its current content. In the web app, edit a published record and choose Save as draft from the save menu; the record then shows its pending changes, with Publish changes, Schedule changes and Discard changes. On an unpublished record, Publish changes reads Apply changes.
const draft = await nohead.drafts.create(id, { data: { title: "Hello, revised" } })await nohead.drafts.update(draft.id, { data: { summary: "Now with more detail" } })const preview = await nohead.drafts.get(draft.id) // data as the record would readawait nohead.drafts.merge(draft.id, { changeNote: "Spring update" })
draft = nohead.drafts.create(record_id, data={"title": "Hello, revised"})nohead.drafts.update(draft.id, data={"summary": "Now with more detail"})preview = nohead.drafts.get(draft.id) # data as the record would readnohead.drafts.merge(draft.id, change_note="Spring update")
draft = nohead.drafts.create(id, data: { title: "Hello, revised" })nohead.drafts.update(draft.id, data: { summary: "Now with more detail" })preview = nohead.drafts.get(draft.id) # data as the record would readnohead.drafts.merge(draft.id, change_note: "Spring update")
One draft per record. Starting a second is 409 with detail code draft_exists and the existing draft_id.
Previews. A draft’s data is the record as it would read after the merge, and GET /v1/drafts/{draft_id} takes expand, so a preview route on your site can render it. changed_fields lists what it changes.
Merging changes content only. A live record stays live and keeps its published_at; an unpublished one stays unpublished. The merge is one merge revision that names the draft and everyone who edited it. Webhooks get record.updated with the draft_id.
Publishing never merges. Publishing a live record that has a draft is 409 with detail code draft_pending. Publishing an unpublished record makes its current content live and keeps the draft.
Edits made since win. Fields the record changed after the draft started keep their values at the merge, unless the draft changes them too. The merge is validated again, unique values included (422).
Bring back an earlier version for review.from_revision starts the draft from that revision’s values instead of the record’s current ones.
Discarding a draft (DELETE /v1/drafts/{draft_id}) leaves the record unchanged.
A record’s schedule publishes it at publish_at and unpublishes it at unpublish_at, within a minute of each time. In the web app, choose Schedule, set Publish at and Unpublish at, and choose Save schedule.
The request sets the whole schedule: a time you leave out is cleared, and DELETE cancels both. Times must be in the future. publish_at needs an unpublished record, and unpublish_at a published one or a publish_at before it. Publishing by hand clears publish_at, unpublishing by hand clears unpublish_at, and deleting the record clears both.A scheduled change is a revision of its own, attributed to the system and made via: scheduler, with the same webhooks as a change by hand. One that can’t be made when it is due is dropped: its time is cleared, the schedule’s last_error says why, and a record.schedule_failed event goes to the activity log and to webhooks that subscribe to it.
A draft merges on its own at merge_at (Schedule changes in the web app). That is how you schedule changes to a live page, such as new prices from Monday. A merge that can’t be made leaves the draft as it is, with schedule.last_error, and sends draft.schedule_failed.
A key with Published records only on (a nohead_pk_ key) reads what your site shows, and nothing else. New keys in the web app have it on by default. Such a key:
lists, reads, counts and searches published records only, and finds an unpublished or deleted record as 404
leaves unpublished records out of expanded relations, and reads only the assets that published records use
gets 403 for drafts, schedules, publications, record history and schema history
holds read scopes only (records:read, schema:read, assets:read, search:read)
Use a published-only key for your site’s build or server, so a draft or an unpublished record can never reach a page.
With it you don’t need a published_at filter; a full-access key lists unpublished records too, unless you filter with filter[published_at][exists]=true. Keep it out of browser code, since the API accepts browser requests only from the web app; for search from the browser, use public search.To rebuild pages when what is live changes, subscribe a webhook to record.* (merges send record.updated, reverts record.reverted) and field.migrated: see Webhooks. Every endpoint is in the API reference.
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Nohead","colors":{"primary":"#171717","light":"#fafafa","dark":"#171717"},"logo":{"light":"https://mintcdn.com/nohead/Zi4ShGp1nnXJjvN2/logo/light.svg?fit=max\u0026auto=format\u0026n=Zi4ShGp1nnXJjvN2\u0026q=85\u0026s=e431964df2c90a7efd8cf3839919156a","dark":"https://mintcdn.com/nohead/Zi4ShGp1nnXJjvN2/logo/dark.svg?fit=max\u0026auto=format\u0026n=Zi4ShGp1nnXJjvN2\u0026q=85\u0026s=0f1626c2856f0e98870466fde414c967","href":"https://nohead.io"},"favicon":"https://mintcdn.com/nohead/Zi4ShGp1nnXJjvN2/favicon.svg?fit=max\u0026auto=format\u0026n=Zi4ShGp1nnXJjvN2\u0026q=85\u0026s=73c7bf765c68dd3524dfa06a8e1a5c55","api":{"playground":{"display":"simple"},"examples":{"languages":["curl","typescript","python","ruby"]}},"footer":{"socials":{"x":"https://x.com/nohead_io","github":"https://github.com/nohead-io"},"links":[{"items":[{"label":"Status","href":"https://status.nohead.io"}]}]},"icons":{"library":"lucide"},"contextual":{"options":["copy","view","claude","chatgpt","download-spec"],"display":"header"},"styling":{"latex":false},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"nohead","hasAudioNarration":false,"actualSubdomain":"nohead","customDomains":["docs.nohead.io"],"gitSource":{"type":"github","owner":"nohead-io","repo":"docs","deployBranch":"main","contentDirectory":"","isPrivate":false,"mountPath":"","label":"","_id":"6ae7050e53ca202614c2eaad"},"chroma":{"latestBuiltDeploymentHistoryId":"6aec9780ada4d37850e32d2e","collectionId":"67023daf-3f94-446b-bf28-d982ad716b31","liveDeploymentHistoryId":"6aec9780ada4d37850e32d2e","schemaVersion":"v3"},"entitlements":{"AI_CHAT":{"status":"ENABLED"},"WEB_MCP":{"status":"ENABLED"},"NARRATION":{"status":"ENABLED"}},"buildId":"6aec9780ada4d37850e32d2e","clientVersion":"0.0.4076","searchFilterCounts":[{"language":"default","tag":"API reference","count":82},{"language":"default","tag":"Endpoints","count":81},{"language":"default","tag":"Guides","count":22},{"language":"default","tag":"CLI","count":14},{"language":"default","tag":"Commands","count":13},{"language":"default","tag":"Assets","count":11},{"language":"default","tag":"Webhooks","count":10},{"language":"default","tag":"Drafts","count":9},{"language":"default","tag":"Fields","count":9},{"language":"default","tag":"Records","count":8}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableContextualStarterQuestions":false,"enableAskAiSearchBar":true},"basePath":"","hasChatPermissions":true,"hasWebMcpPermissions":true,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"sso-setup-deadline-banner","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"comment-mode","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":false},"customCss":[{"filePath":"style.css","content":"img[src$=\"/icons/typescript.svg\"]{--icon: url(\"/icons/typescript.svg\")}img[src$=\"/icons/python.svg\"]{--icon: url(\"/icons/python.svg\")}img[src$=\"/icons/ruby.svg\"]{--icon: url(\"/icons/ruby.svg\")}img:is([src$=\"/icons/typescript.svg\"],[src$=\"/icons/python.svg\"],[src$=\"/icons/ruby.svg\"]){box-sizing:border-box;padding-left:1rem;background-color:rgb(var(--gray-400))!important;-webkit-mask:var(--icon) center / contain no-repeat;mask:var(--icon) center / contain no-repeat}.dark img:is([src$=\"/icons/typescript.svg\"],[src$=\"/icons/python.svg\"],[src$=\"/icons/ruby.svg\"]){background-color:rgb(var(--gray-500))!important}[aria-current] img:is([src$=\"/icons/typescript.svg\"],[src$=\"/icons/python.svg\"],[src$=\"/icons/ruby.svg\"]){background-color:rgb(var(--primary))!important}.dark [aria-current] img:is([src$=\"/icons/typescript.svg\"],[src$=\"/icons/python.svg\"],[src$=\"/icons/ruby.svg\"]){background-color:rgb(var(--primary-light))!important}"}],"page":{"pagePath":"guides/publishing","slug":"/guides/publishing","pageMetadata":{"title":"Drafts and publishing","icon":"send","description":"Publish and unpublish records, hold changes back in a draft, schedule both, and read only published content from your site.","href":"/guides/publishing"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Publish and unpublish records, hold changes back in a draft, schedule both, and read only published content from your site.\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,li:`li`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,ul:`ul`,..._provideComponents(),...props.components},{CodeBlock,CodeGroup,Heading,Tip}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!CodeGroup)_missingMdxReference(`CodeGroup`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Tip)_missingMdxReference(`Tip`,true);return _jsxs(_Fragment,{children:[_jsxs(_components.p,{children:[`Records start unpublished. A record is live when it has a `,_jsx(_components.code,{children:`published_at`}),`, and what is live is its current content: an edit to a published record reaches your site at once. To hold changes back until they are ready, put them in a draft.`]}),`\n`,_jsx(Heading,{level:`2`,id:`publish-and-unpublish`,children:`Publish and unpublish`}),`\n`,_jsxs(_components.p,{children:[`In the web app, open a record and choose `,_jsx(_components.strong,{children:`Publish`}),` or `,_jsx(_components.strong,{children:`Unpublish`}),`. Through the API, publishing is the record’s `,_jsx(_components.code,{children:`publication`}),`:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`2`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`2`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -X`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` POST`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"https://api.nohead.io/v1/records/rec_01J9ZQ3F8X/publication\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Authorization: Bearer `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$NOHEAD_API_KEY`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`DELETE`}),` on the same URL unpublishes, and `,_jsx(_components.code,{children:`GET`}),` says since when the record is live, the live revision and who published it (`,_jsx(_components.code,{children:`404`}),` with detail code `,_jsx(_components.code,{children:`not_published`}),` for a record that isn’t live).`]}),`\n`,_jsxs(CodeGroup,{children:[_jsx(CodeBlock,{filename:`TypeScript`,numberOfLines:`3`,language:`typescript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`typescript`,children:_jsxs(_components.code,{language:`typescript`,numberOfLines:`3`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` nohead`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`records`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`publish`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`id`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` live`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` nohead`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`records`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`publication`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`id`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) `}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// published_at, revision, published_by`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` nohead`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`records`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`unpublish`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`id`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`]})})}),_jsx(CodeBlock,{filename:`Python`,numberOfLines:`3`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`3`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`nohead.records.publish(record_id)`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`live `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` nohead.records.publication(record_id) `}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# published_at, revision, published_by`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`nohead.records.unpublish(record_id)`})}),`\n`]})})}),_jsx(CodeBlock,{filename:`Ruby`,numberOfLines:`3`,language:`ruby`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`ruby`,children:_jsxs(_components.code,{language:`ruby`,numberOfLines:`3`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`nohead.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`records`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`publish`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(id)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`live`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` nohead.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`records`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`publication`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(id) `}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# published_at, revision, published_by`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`nohead.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`records`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`unpublish`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(id)`})]}),`\n`]})})})]}),`\n`,_jsxs(_components.p,{children:[`Each is a `,_jsx(_components.code,{children:`publish`}),` or `,_jsx(_components.code,{children:`unpublish`}),` revision in the record’s `,_jsx(_components.a,{href:`/guides/history`,children:`history`}),`, and takes a change note and `,_jsx(_components.code,{children:`If-Match`}),` like any record write. Publishing a published record, or unpublishing an unpublished one, changes nothing. Unpublishing keeps the content, and publishing again sets a new `,_jsx(_components.code,{children:`published_at`}),`.`]}),`\n`,_jsxs(_components.p,{children:[`To publish or unpublish up to 100 records at once, `,_jsx(_components.code,{children:`POST /v1/collections/{collection_id}/record-batches`}),` with `,_jsx(_components.code,{children:`action: \"publish\"`}),` or `,_jsx(_components.code,{children:`\"unpublish\"`}),` and their `,_jsx(_components.code,{children:`record_ids`}),`. Each record is changed as if by its own request, and one that fails doesn’t stop the others.`]}),`\n`,_jsxs(_components.p,{children:[`In the web app, Editors and every role above can publish; Viewers can’t. API keys publish with `,_jsx(_components.code,{children:`records:write`}),`.`]}),`\n`,_jsx(Heading,{level:`2`,id:`hold-changes-back-in-a-draft`,children:`Hold changes back in a draft`}),`\n`,_jsxs(_components.p,{children:[`A draft holds changes to a record until they are merged into it, while the record keeps its current content. In the web app, edit a published record and choose `,_jsx(_components.strong,{children:`Save as draft`}),` from the save menu; the record then shows its pending changes, with `,_jsx(_components.strong,{children:`Publish changes`}),`, `,_jsx(_components.strong,{children:`Schedule changes`}),` and `,_jsx(_components.strong,{children:`Discard changes`}),`. On an unpublished record, `,_jsx(_components.strong,{children:`Publish changes`}),` reads `,_jsx(_components.strong,{children:`Apply changes`}),`.`]}),`\n`,_jsxs(CodeGroup,{children:[_jsx(CodeBlock,{filename:`TypeScript`,numberOfLines:`4`,language:`typescript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`typescript`,children:_jsxs(_components.code,{language:`typescript`,numberOfLines:`4`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` draft`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` nohead`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`drafts`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`create`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`id`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, { `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`data:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`title:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Hello, revised\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` } })`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` nohead`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`drafts`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`update`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`draft`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`id`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, { `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`data:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`summary:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Now with more detail\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` } })`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` preview`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` nohead`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`drafts`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`get`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`draft`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`id`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) `}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// data as the record would read`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` nohead`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`drafts`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`merge`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`draft`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`id`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, { `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`changeNote:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Spring update\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` })`})]}),`\n`]})})}),_jsx(CodeBlock,{filename:`Python`,numberOfLines:`4`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`4`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`draft `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` nohead.drafts.create(record_id, `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`data`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"title\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Hello, revised\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`})`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`nohead.drafts.update(draft.id, `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`data`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"summary\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Now with more detail\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`})`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`preview `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` nohead.drafts.get(draft.id) `}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# data as the record would read`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`nohead.drafts.merge(draft.id, `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`change_note`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Spring update\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`]})})}),_jsx(CodeBlock,{filename:`Ruby`,numberOfLines:`4`,language:`ruby`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`ruby`,children:_jsxs(_components.code,{language:`ruby`,numberOfLines:`4`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`draft`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` nohead.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`drafts`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`create`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(id, `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`data:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`title:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Hello, revised\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` })`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`nohead.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`drafts`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`update`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(draft.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`id`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`data:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`summary:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Now with more detail\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` })`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`preview`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` nohead.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`drafts`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`get`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(draft.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`id`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) `}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# data as the record would read`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`nohead.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`drafts`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`merge`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(draft.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`id`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`change_note:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Spring update\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`]})})})]}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`One draft per record.`}),` Starting a second is `,_jsx(_components.code,{children:`409`}),` with detail code `,_jsx(_components.code,{children:`draft_exists`}),` and the existing `,_jsx(_components.code,{children:`draft_id`}),`.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Previews.`}),` A draft’s `,_jsx(_components.code,{children:`data`}),` is the record as it would read after the merge, and `,_jsx(_components.code,{children:`GET /v1/drafts/{draft_id}`}),` takes `,_jsx(_components.code,{children:`expand`}),`, so a preview route on your site can render it. `,_jsx(_components.code,{children:`changed_fields`}),` lists what it changes.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Merging changes content only.`}),` A live record stays live and keeps its `,_jsx(_components.code,{children:`published_at`}),`; an unpublished one stays unpublished. The merge is one `,_jsx(_components.code,{children:`merge`}),` revision that names the draft and everyone who edited it. Webhooks get `,_jsx(_components.code,{children:`record.updated`}),` with the `,_jsx(_components.code,{children:`draft_id`}),`.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Publishing never merges.`}),` Publishing a live record that has a draft is `,_jsx(_components.code,{children:`409`}),` with detail code `,_jsx(_components.code,{children:`draft_pending`}),`. Publishing an unpublished record makes its current content live and keeps the draft.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Edits made since win.`}),` Fields the record changed after the draft started keep their values at the merge, unless the draft changes them too. The merge is validated again, unique values included (`,_jsx(_components.code,{children:`422`}),`).`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Bring back an earlier version for review.`}),` `,_jsx(_components.code,{children:`from_revision`}),` starts the draft from that revision’s values instead of the record’s current ones.`]}),`\n`]}),`\n`,_jsxs(_components.p,{children:[`Discarding a draft (`,_jsx(_components.code,{children:`DELETE /v1/drafts/{draft_id}`}),`) leaves the record unchanged.`]}),`\n`,_jsx(Heading,{level:`2`,id:`schedule-publishing`,children:`Schedule publishing`}),`\n`,_jsxs(_components.p,{children:[`A record’s schedule publishes it at `,_jsx(_components.code,{children:`publish_at`}),` and unpublishes it at `,_jsx(_components.code,{children:`unpublish_at`}),`, within a minute of each time. In the web app, choose `,_jsx(_components.strong,{children:`Schedule`}),`, set `,_jsx(_components.strong,{children:`Publish at`}),` and `,_jsx(_components.strong,{children:`Unpublish at`}),`, and choose `,_jsx(_components.strong,{children:`Save schedule`}),`.`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`4`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`4`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -X`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` PUT`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"https://api.nohead.io/v1/records/rec_01J9ZQ3F8X/schedule\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Authorization: Bearer `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$NOHEAD_API_KEY`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Content-Type: application/json\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -d`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` '{\"publish_at\": \"2026-11-02T08:00:00Z\", \"unpublish_at\": \"2026-11-30T23:00:00Z\"}'`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`The request sets the whole schedule: a time you leave out is cleared, and `,_jsx(_components.code,{children:`DELETE`}),` cancels both. Times must be in the future. `,_jsx(_components.code,{children:`publish_at`}),` needs an unpublished record, and `,_jsx(_components.code,{children:`unpublish_at`}),` a published one or a `,_jsx(_components.code,{children:`publish_at`}),` before it. Publishing by hand clears `,_jsx(_components.code,{children:`publish_at`}),`, unpublishing by hand clears `,_jsx(_components.code,{children:`unpublish_at`}),`, and deleting the record clears both.`]}),`\n`,_jsxs(_components.p,{children:[`A scheduled change is a revision of its own, attributed to the system and made `,_jsx(_components.code,{children:`via: scheduler`}),`, with the same webhooks as a change by hand. One that can’t be made when it is due is dropped: its time is cleared, the schedule’s `,_jsx(_components.code,{children:`last_error`}),` says why, and a `,_jsx(_components.code,{children:`record.schedule_failed`}),` event goes to the activity log and to webhooks that subscribe to it.`]}),`\n`,_jsx(Heading,{level:`2`,id:`schedule-a-draft`,children:`Schedule a draft`}),`\n`,_jsxs(_components.p,{children:[`A draft merges on its own at `,_jsx(_components.code,{children:`merge_at`}),` (`,_jsx(_components.strong,{children:`Schedule changes`}),` in the web app). That is how you schedule changes to a live page, such as new prices from Monday. A merge that can’t be made leaves the draft as it is, with `,_jsx(_components.code,{children:`schedule.last_error`}),`, and sends `,_jsx(_components.code,{children:`draft.schedule_failed`}),`.`]}),`\n`,_jsxs(CodeGroup,{children:[_jsx(CodeBlock,{filename:`TypeScript`,numberOfLines:`6`,language:`typescript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`typescript`,children:_jsxs(_components.code,{language:`typescript`,numberOfLines:`6`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` nohead`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`records`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`schedule`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`id`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, { `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`publish_at:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"2026-11-02T08:00:00Z\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` })`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` nohead`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`drafts`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`schedule`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"drf_01J9ZQ3F8X\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, { `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`merge_at:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"2026-11-02T08:00:00Z\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` })`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`for`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` change`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` of`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` nohead`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`records`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`scheduledChanges`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"blog-posts\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)) {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` console`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`log`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`change`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`action`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`change`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`at`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`change`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`record_id`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) `}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// publish, unpublish or merge`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),_jsx(CodeBlock,{filename:`Python`,numberOfLines:`5`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`5`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`nohead.records.schedule(record_id, `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`publish_at`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"2026-11-02T08:00:00Z\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`nohead.drafts.schedule(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"drf_01J9ZQ3F8X\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`merge_at`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"2026-11-02T08:00:00Z\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`for`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` change `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`in`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` nohead.records.scheduled_changes(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"blog-posts\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`):`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:` print`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(change.action, change.at, change.record_id) `}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# publish, unpublish or merge`})]}),`\n`]})})}),_jsx(CodeBlock,{filename:`Ruby`,numberOfLines:`6`,language:`ruby`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`ruby`,children:_jsxs(_components.code,{language:`ruby`,numberOfLines:`6`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`nohead.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`records`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`schedule`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(id, `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`publish_at:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"2026-11-02T08:00:00Z\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`nohead.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`drafts`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`schedule`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"drf_01J9ZQ3F8X\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`merge_at:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"2026-11-02T08:00:00Z\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`nohead.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`records`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`scheduled_changes`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"blog-posts\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`).`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`each`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` do`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` |`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`change`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`|`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:` puts`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`#{`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#D4D4D4`},children:`change.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`action`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`}`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` #{`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#D4D4D4`},children:`change.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`at`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`}`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` #{`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#D4D4D4`},children:`change.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`record_id`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`}`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` # publish, unpublish or merge`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`end`})}),`\n`]})})})]}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`GET /v1/collections/{collection_id}/scheduled-changes`}),` lists every pending change of a collection’s records, soonest first.`]}),`\n`,_jsx(Heading,{level:`2`,id:`published-only-api-keys`,children:`Published-only API keys`}),`\n`,_jsxs(_components.p,{children:[`A key with `,_jsx(_components.strong,{children:`Published records only`}),` on (a `,_jsx(_components.code,{children:`nohead_pk_`}),` key) reads what your site shows, and nothing else. New keys in the web app have it on by default. Such a key:`]}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[`lists, reads, counts and searches published records only, and finds an unpublished or deleted record as `,_jsx(_components.code,{children:`404`})]}),`\n`,_jsxs(_components.li,{children:[`leaves unpublished records out of `,_jsx(_components.code,{children:`expanded`}),` relations, and reads only the assets that published records use`]}),`\n`,_jsxs(_components.li,{children:[`gets `,_jsx(_components.code,{children:`403`}),` for drafts, schedules, publications, record history and schema history`]}),`\n`,_jsxs(_components.li,{children:[`holds read scopes only (`,_jsx(_components.code,{children:`records:read`}),`, `,_jsx(_components.code,{children:`schema:read`}),`, `,_jsx(_components.code,{children:`assets:read`}),`, `,_jsx(_components.code,{children:`search:read`}),`)`]}),`\n`]}),`\n`,_jsx(Tip,{children:_jsx(_components.p,{children:`Use a published-only key for your site’s build or server, so a draft or an unpublished record can never reach a page.`})}),`\n`,_jsxs(_components.p,{children:[`With it you don’t need a `,_jsx(_components.code,{children:`published_at`}),` filter; a full-access key lists unpublished records too, unless you filter with `,_jsx(_components.code,{children:`filter[published_at][exists]=true`}),`. Keep it out of browser code, since the API accepts browser requests only from the web app; for search from the browser, use `,_jsx(_components.a,{href:`/guides/public-search`,children:`public search`}),`.`]}),`\n`,_jsxs(_components.p,{children:[`To rebuild pages when what is live changes, subscribe a webhook to `,_jsx(_components.code,{children:`record.*`}),` (merges send `,_jsx(_components.code,{children:`record.updated`}),`, reverts `,_jsx(_components.code,{children:`record.reverted`}),`) and `,_jsx(_components.code,{children:`field.migrated`}),`: see `,_jsx(_components.a,{href:`/guides/webhooks`,children:`Webhooks`}),`. Every endpoint is in the `,_jsx(_components.a,{href:`/api-reference/overview`,children:`API reference`}),`.`]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Drafts and publishing","icon":"send","description":"Publish and unpublish records, hold changes back in a draft, schedule both, and read only published content from your site.","href":"/guides/publishing"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Publish and unpublish","slug":"publish-and-unpublish","depth":2,"children":[]},{"title":"Hold changes back in a draft","slug":"hold-changes-back-in-a-draft","depth":2,"children":[]},{"title":"Schedule publishing","slug":"schedule-publishing","depth":2,"children":[]},{"title":"Schedule a draft","slug":"schedule-a-draft","depth":2,"children":[]},{"title":"Published-only API keys","slug":"published-only-api-keys","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":[],"subdomain":"nohead","siteName":"Nohead","title":"Drafts and publishing - Nohead","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-11-01T09:23:55.413Z","originalFileLocation":"guides/publishing.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Publish and unpublish records, hold changes back in a draft, schedule both, and read only published content from your site.\">\u003cmeta data-mint-head name=\"application-name\" content=\"Nohead\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/nohead/rS-6Mxl34NeSIeuO/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/nohead/rS-6Mxl34NeSIeuO/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/nohead/rS-6Mxl34NeSIeuO/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/nohead/rS-6Mxl34NeSIeuO/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/nohead/rS-6Mxl34NeSIeuO/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/nohead/rS-6Mxl34NeSIeuO/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/nohead/rS-6Mxl34NeSIeuO/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/nohead/rS-6Mxl34NeSIeuO/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/nohead/rS-6Mxl34NeSIeuO/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Drafts and publishing - Nohead\">\u003cmeta data-mint-head property=\"og:description\" content=\"Publish and unpublish records, hold changes back in a draft, schedule both, and read only published content from your site.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Nohead\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.nohead.io/guides/publishing\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://nohead.mintlify.site/_mintlify/api/og/v2?division=Content\u0026amp;title=Drafts+and+publishing\u0026amp;description=Publish+and+unpublish+records%2C+hold+changes+back+in+a+draft%2C+schedule+both%2C+and+read+only+published+content+from+your+site.\u0026amp;theme=5304bc0da6bac525d02ea050\u0026amp;signature=27a0b7fc605d35ec539d8c3600eb7cd433797db376ca9760ccc8540bc5df0851\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Drafts and publishing - Nohead\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Publish and unpublish records, hold changes back in a draft, schedule both, and read only published content from your site.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://nohead.mintlify.site/_mintlify/api/og/v2?division=Content\u0026amp;title=Drafts+and+publishing\u0026amp;description=Publish+and+unpublish+records%2C+hold+changes+back+in+a+draft%2C+schedule+both%2C+and+read+only+published+content+from+your+site.\u0026amp;theme=5304bc0da6bac525d02ea050\u0026amp;signature=27a0b7fc605d35ec539d8c3600eb7cd433797db376ca9760ccc8540bc5df0851\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/nohead/rS-6Mxl34NeSIeuO/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Nohead\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#171717\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.nohead.io/guides/publishing\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/guides/publishing.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.nohead.io/#organization\",\"name\":\"Nohead\",\"url\":\"https://docs.nohead.io\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/nohead/Zi4ShGp1nnXJjvN2/logo/light.svg?fit=max\u0026auto=format\u0026n=Zi4ShGp1nnXJjvN2\u0026q=85\u0026s=e431964df2c90a7efd8cf3839919156a\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.nohead.io#website\",\"name\":\"Nohead\",\"url\":\"https://docs.nohead.io\",\"publisher\":{\"@id\":\"https://docs.nohead.io/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.nohead.io/guides/publishing#webpage\",\"url\":\"https://docs.nohead.io/guides/publishing\",\"name\":\"Drafts and publishing\",\"description\":\"Publish and unpublish records, hold changes back in a draft, schedule both, and read only published content from your site.\",\"dateModified\":\"2026-11-01T09:23:55.413Z\",\"isPartOf\":{\"@id\":\"https://docs.nohead.io#website\"},\"breadcrumb\":{\"@id\":\"https://docs.nohead.io/guides/publishing#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.nohead.io/guides/publishing#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Content\",\"item\":\"https://docs.nohead.io/guides/reading-content\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Drafts and publishing\",\"item\":\"https://docs.nohead.io/guides/publishing\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://docs.nohead.io/guides/publishing#article\",\"headline\":\"Drafts and publishing\",\"name\":\"Drafts and publishing\",\"description\":\"Publish and unpublish records, hold changes back in a draft, schedule both, and read only published content from your site.\",\"url\":\"https://docs.nohead.io/guides/publishing\",\"mainEntityOfPage\":{\"@id\":\"https://docs.nohead.io/guides/publishing#webpage\"},\"dateModified\":\"2026-11-01T09:23:55.413Z\",\"publisher\":{\"@id\":\"https://docs.nohead.io/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.nohead.io#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Nohead\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"Nohead","nav":{"global":null,"tabs":[{"tab":"Guides","groups":[{"group":"Get started","pages":[{"title":"Introduction","icon":"book-open","href":""},{"title":"Get started","icon":"rocket","href":"/quickstart"},{"title":"API keys","icon":"key-round","href":"/guides/api-keys"}]},{"group":"Agents","pages":[{"title":"Work with agents","sidebarTitle":"Overview","icon":"sparkles","href":"/guides/agents"},{"title":"Coding agents","icon":"bot","href":"/guides/coding-agents"},{"title":"MCP server","icon":"plug","href":"/guides/mcp"}]},{"group":"Model","pages":[{"title":"Content modelling","icon":"layers","href":"/guides/content-modelling"},{"title":"Field migrations","icon":"arrow-right-left","href":"/guides/field-migrations"},{"title":"Schema as code","icon":"file-code","href":"/guides/schema-as-code"}]},{"group":"Content","pages":[{"title":"Reading content","icon":"file-text","href":"/guides/reading-content"},{"title":"Writing content","icon":"pen-line","description":"Create and update records, set each kind of field, sync content without duplicates, change many records at once, and delete and restore them.","href":"/guides/writing-content"},{"title":"Drafts and publishing","icon":"send","href":"/guides/publishing"},{"title":"Revisions and history","icon":"history","description":"See who changed a record, when, through what and why, compare any two versions, revert, redact values that should never have been stored, and read the organization's activity log.","href":"/guides/history"}]},{"group":"Assets","pages":[{"title":"Assets","icon":"upload","href":"/guides/assets"},{"title":"Images and files","icon":"image","href":"/guides/images"}]},{"group":"Search","pages":[{"title":"API search","icon":"search","href":"/guides/api-search"},{"title":"Public search","icon":"search-code","href":"/guides/public-search"}]},{"group":"Integrate","pages":[{"title":"Webhooks","icon":"webhook","href":"/guides/webhooks"},{"title":"Errors and retries","icon":"triangle-alert","href":"/guides/errors-and-retries"}]},{"group":"Organization","pages":[{"title":"Members and roles","icon":"users","href":"/guides/members-and-roles"},{"title":"Plans and usage","icon":"gauge","href":"/guides/plans-and-usage"},{"title":"API requests","icon":"gauge","href":"/guides/api-requests"}]}]},{"tab":"API reference","pages":[{"title":"API reference","href":"/api-reference/overview"}]},{"tab":"SDKs","pages":[{"title":"SDKs","href":"/sdks/overview"}]},{"tab":"CLI","pages":[{"title":"CLI","href":"/cli/overview"}]}]},"basePath":"","title":"Drafts and publishing - Nohead","buildId":"dpl_8LJbrAiZvr1K98WQNZXCyY5AvT34","deploymentId":"dpl_8LJbrAiZvr1K98WQNZXCyY5AvT34","dynamics":[],"chunks":[]}