Strapi Content Publishing (Draft & Publish and the status parameter)#
Overview#
In Strapi 5, Draft & Publish gives each document a draft version and an optional published version. The status parameter, which accepts draft or published, selects which version a query returns. The Content API (REST, GraphQL) and the backend Document Service API all use it. It replaced v4's publicationState (live / preview) .
The feature is opt-in per content type. options.draftAndPublish must be true, and hasDraftAndPublish checks this . The REST route contract only exposes status when the option is enabled .
Defaults differ by API layer#
This is the most common source of confusion.
| Layer | Default when status is omitted |
|---|---|
| REST API (frontend) | published. Omitting status is the same as status=published . |
| Document Service API (backend) | draft. Passing status: 'draft' is the same as passing nothing . |
- The REST default is set in
getFetchParams, which putsstatus: 'published'before the caller's params, so an explicit status overrides it . - The REST validator accepts only
draftorpublished. - There is no fallback in v5. A query for
publisheddoes not return the draft when no published version exists .
How status becomes a query#
For draft-and-publish content types, the Document Service turns status into a publishedAt lookup :
publishedaddspublishedAt: { $notNull: true }.draftaddspublishedAt: { $null: true }.
A draft response therefore has publishedAt: null . Check publishedAt to tell which version you got.
Frontend visibility checklist#
If an article does not show up on the website, check these:
- Is the entry published? A new entry is a draft until you publish it. The Content Manager shows Published, Modified (the draft has unpublished changes) or Draft (never published) .
- Does the frontend request
status=draftorpublished? Anything that still sendspublicationStateneeds a manual update, because there is no codemod for frontend REST or GraphQL calls . - Are related entries published? Publishing a document that relates to unpublished content can leave some of that content unavailable through the API .
- Is the locale right? With i18n, bulk publish and unpublish only apply to the selected locale . See the locale-scoped publishing topic.
- Does the Published tab match the Draft tab? The Published tab is read-only and shows what the API serves. One reported case on Strapi 5.50.2 had a Latvian-locale entry whose Published tab still held older content after an apparent publish, so some users saw stale content. The reporter only noticed by opening the Published tab, and had to edit the draft again to re-enable Publish. This is an open user report, not a confirmed bug .
Document Service usage#
- Pass
status: 'published'tofindOne,findFirstandfindManyto read published versions . - Pass
status: 'published'tocreate()orupdate()to publish in the same call . count({ status: 'draft' })also counts documents that are already published, because every published document has a draft counterpart .
Related references#
- Scheduled publishing is done by adding entries to a release and scheduling it .
- Unpublishing offers "keep last draft" or "replace last draft" .
- Docs pages: Draft & Publish feature, REST
status, Document Servicestatus,publicationStatebreaking change. - Code entry points are
packages/core/core/src/services/document-service/draft-and-publish.ts,packages/core/core/src/core-api/service/core-service.tsandpackages/core/core/src/core-api/routes/validation/content-type.ts.