status cannot be used as an attribute name when Draft & Publish is enabled
In Strapi 5, status is the reserved parameter used by the Document Service API and REST API to distinguish draft and published content. A user-defined attribute also named status on a Draft & Publish-enabled content type causes a naming collision.
This page is part of the breaking changes database and provides information about the breaking change and additional instructions to migrate from Strapi v4 to Strapi 5.
Breaking change description
In Strapi v4
Content types with Draft & Publish enabled can have a user-defined attribute named status. No conflict exists between this attribute name and the publication workflow, which uses the publicationState parameter.
In Strapi 5
status is the reserved query parameter for Draft & Publish (it replaced publicationState). Defining a user attribute named status on a Draft & Publish-enabled content type causes a naming collision. Strapi 5 enforces this restriction as follows:
- Content-type Builder: Blocks creating a
statusattribute on any content type that has Draft & Publish enabled. Also blocks enabling Draft & Publish on a content type that already has astatusattribute. - Server bootstrap: Logs a warning (once per content type UID) when a
statusattribute is detected alongside Draft & Publish. The server continues booting so existing projects are not broken.
Migration
This section regroups useful notes and procedures about the introduced breaking change.
Notes
- The
statusattribute name is also part of the broader list of globally reserved names in Strapi 5. See Some attributes and content-types names are reserved for the full list. - This breaking change adds a context-specific restriction: the
statuscollision is only enforced when Draft & Publish is enabled on the content type. - See Draft & Publish for details on how the
statusparameter works for querying draft and published content.
Manual procedure
If a content type has a status attribute and Draft & Publish is enabled (or you intend to enable it), rename the status attribute before enabling Draft & Publish.
- In the Content-type Builder, open the content type that has a
statusattribute. - Rename the
statusattribute to a non-reserved name (for example,approval_statusorworkflow_state). - Click Save to apply the schema change.
- Update any queries, controllers, services, policies, or front-end code that references the old
statusattribute name. - If Draft & Publish was blocked from being enabled, re-enable it in the Advanced settings tab of the content type.