← All playbooks · Raw API
task-publish-handoff
# Capability: Publish
## Intent phrases
- publish changes
- unpublish
- archive
- delete
- revalidate this page
- go live
## Requires capabilities
The signed-in Contentful user must have the matching role permission. AI Editor cannot publish.
## What cms-edit does
`save` creates drafts. Publishing is a separate command.
1. `publish plan` (or `unpublish plan`, `archive plan`, `delete plan`, `revalidate plan`) is read-only. It returns a plan id.
2. If someone else also changed an entry in that plan, stop and ask: publish **all** of those entries, or **mine** only. One entry cannot be split by field. Record the answer with `publish choose --plan <id> --scope all|mine`.
3. Apply only after the user says yes: `publish apply --plan <id>`. Do not apply on your own. The same yes is required for unpublish, archive, delete, and revalidate. Hosted clients with typed tools can use `release_plan` and `release_apply` (`userConfirmed: true` only after the user said yes; `dryRun: true` checks without writing).
## What gets published
- A page publishes its draft and changed assets and components first, then the page. That page publish is what refreshes the live site.
- The walk does not enter another page, article, or person, and it does not enter a shared template.
- `schema`, `template`, `navigation`, and the other webhook types can be the target (`--content-type schema`, `--id`, or `--from-session`). Publishing them refreshes caches through their own webhook. Do not republish every page that uses them.
- A schema linked only from an unpublished page is named in the plan. Publishing the schema does not add that link to the live page.
- `publish plan --id` publishes only those ids. It does not pull in linked drafts or parent pages. Repeat `--id` to name more than one. `--with-parents` opts into the parent walk.
- When publishing a page (or a nested entry) with `--id` and the listing or parent page must go live too, pass `--with-parents`. Equivalent: open the parent/listing page or use `--from-session`, then `publish plan` without `--id`. Do not rely on `--id` alone to refresh listings.
- An open page, `--from-session`, or `--id --with-parents` publishes the draft and what it needs. A component on that path publishes its own changes, then the pages that use it. The parent walk climbs through components and collections and stops at the first root. A template on that path is republished itself, because its webhook refreshes the pages that use it. The walk does not continue into those pages.
- `location` is a root only when the site's `project.json` lists it under `publish.extraRootContentTypes` and the editor pack has been regenerated.
- Unpublish and archive affect the named entries only, not their children, and take exact ids. **Archive is guarded; read `plan.guards` to the user.** It takes exact entry ids only (never a slug, and `--content-type`, `--since` and `--from-session` are rejected even alongside `--id`), and the plan carries a check report (`guards`) that lists every failure with a fix. It is refused unless: (a) each entry is already unpublished, or the user agreed and the plan was made with `--unpublish-ok` / `unpublishOk: true`; (b) no published entry still links to it, checked against the live (published) site through the Content Delivery API, so a draft that dropped the link but was not published still counts (draft-only and archived referrers are ignored; entries archived or unpublished in the same call are allowed; if the live check cannot be made, archive is refused); (c) a page that has a slug or was ever published has a published, active Redirect from its URL (`fromPath`) to a live destination (a `toPath`, or a `toInternal` entry that is published and not archived); the Redirect `fromPath` must be the real public URL: `/<slug>/` for a `page` or `customType`, and for an article, person or tag the prefix from the site's `marketing-routes.json` (copied into the editor pack), for example `/blog/my-post/` for an article of type `blog`; if the routes config is not in the pack or the type has no route mapping, the entry is refused with a message that the URL prefix could not be resolved (never guessed as `/<slug>/`), and other types cannot be checked at all (unpublish them instead); (d) nobody else has unpublished changes on it (an unpublished entry is compared with its last published version, so a clean unpublish by a colleague does not block; a never-published draft is only allowed when it provably has the caller's single save, otherwise it is refused). Components the page used are reported (`leftoverSharedComponents` still live elsewhere, `unusedComponents`) and are never archived unless their ids are named in the same call and pass every check. `apply` re-runs every check and changes nothing if one fails. `--dry-run` (on `archive plan` and `archive apply`) prints the report and writes nothing, even with confirmation set. `unarchive plan/apply` restores a draft and does not publish. Never pass `unpublishOk` unless the user said to unpublish. Never archive a component the user did not name.
- **Delete.** `delete plan --id <id>` deletes draft-only entries. A published entry needs the user to choose: **unpublish then delete** (`--published delete`) or **unpublish then archive** (`--published archive`). Without `--published` the plan is refused with that question. Ask the user; do not pick for them. Deleting cannot be undone, and the plan lists entries that still link to it. This applies to every entry type: pages, articles, people, article types, tags, tag types, person types, custom types, page variants, page tests, templates.
- **Redirects.** Name a Redirect by exact id (`publish plan --id <redirectId>`) to publish it. A Redirect linked from a page is still not pulled in. The plan and the apply output carry `needsDeploy: true`: a Redirect only takes effect after the site is redeployed or its redirect map is revalidated, so never tell the user it is live after apply. Before planning, and again at apply, the Redirect is checked against every other Redirect: another active Redirect with the same source (case and trailing slash ignored), a loop, or a source equal to its destination refuse the plan and nothing is published. A chain (the destination is itself redirected, or something already redirects to the source) is a warning in `plan.redirectChecks`. If the Redirects cannot all be read, the plan is refused. Create one with `create redirect` (see `help create-editor-entries`).
## Revalidate
`revalidate plan` refreshes production cache for the named pages and does not publish. The host needs `REVALIDATION_SECRET` and `PRODUCTION_SITE_URL`. The request goes to `{PRODUCTION_SITE_URL}` plus `/api/revalidate`, or plus `REVALIDATION_PATH` when that is set. If those are missing, publishing the page still refreshes the site through the Contentful webhook.
## Confirmation gates
1. Do not apply a plan unless the user has said yes for that plan id.
2. Do not claim the site is updated until apply succeeds.
3. There is no scheduled publish.
## Before a production promote
Publishing in Contentful is not the same as a git promote. Before merging integration → production when new or changed entries are involved:
1. List every page, **template**, **person** / person-type, and other linked entries the live pages render through.
2. Confirm each is published in the production environment with **no pending drafts** (CDA vs CPA, or `check-publish-state`).
3. Record the result on the promote PR.
Shared templates and person entries are easy to leave draft-only while the page looks fine in preview — that is what broke Brightline provider headshots (7 Oct 2026). Full rules: se-core-product `docs/RELEASE_VERIFICATION.md`.