Strapi 5 REST response format and documentId for front ends

Strapi 5 flattens REST responses and uses documentId instead of id, which breaks front ends that read the v4 attributes wrapper. This page shows how to switch clients safely with the v4 compatibility header and then remove it.

On this page

Why Strapi 5 front ends break on the new response format

Front ends break after a Strapi 5 upgrade because the REST response shape changed and the clients were written against the v4 shape. Strapi 5 removes the attributes wrapper, so fields that used to sit under data.attributes now appear directly on each record, and it identifies records by documentId instead of a numeric id. A web app, a mobile app or a static build step that reads item.attributes.title or keys its cache and routes on id will fail or render empty content, even when the content itself migrated correctly. The problem is in the consumers, not in the data, so a successful database migration does not prove the front ends will work.

The Strapi-Response-Format: v4 header is the bridge. Sending it returns the old response format during migration, which lets you deploy the upgraded Strapi backend while existing clients keep working. It is a transition control, not a permanent setting. Each client has to be moved to the flattened format and to documentId before the header is removed for it, and that work is per client. Confirm for each consumer whether it sends the header on its own, whether it can be changed without a release, and whether any proxy, CDN or build cache strips or caches responses in a way that mixes formats. Strapi v4 reached end of life on April 30, 2026, so teams still on v4 are working against a fixed path forward, and client changes should be scheduled inside that upgrade plan rather than left until the end.

Plan the client inventory before the backend switch. List every consumer that reads Strapi REST output, including scheduled builds, webhooks, search indexers and internal tools, and record which fields and identifiers each one uses. Then decide the order in which clients move and test each one against a staging Strapi 5 instance with the header on and off. For the GraphQL side of the same change, see the sibling page on Strapi 5 GraphQL API changes, which covers the related v4CompatibilityMode option.

What changes in REST responses and identifiers

This table compares four Strapi 5 changes against what they mean for front-end code and what your team needs to do about each one. Read each row alongside a sample response from your own API, because exact field handling depends on your content types and plugins. The main takeaway is that the response shape and the identifier used for single-item requests both change, so front ends need updates before the server is switched over.

ChangeImpact on front endsAction needed
Attributes wrapper removedFields that were nested under attributes in v4 responses are returned at the top level of each entry in Strapi 5, so property lookups in components and data layers can break.Capture a sample response from each endpoint, update field access in components and typed models, and confirm nested relations and components in your own responses.
id replaced by documentId for single-item requestsClients that fetch, update or delete one entry by its numeric id need to use documentId instead, and stored references to ids may stop resolving.Find every place the front end stores or sends an id, switch single-item routes to documentId, and check how cached or bookmarked URLs are handled.
Strapi-Response-Format: v4 headerSending this header returns the v4 response format during migration, so clients can move one at a time instead of all at once.Add the header to requests from clients not yet updated, record which clients still send it, and plan its removal once each client handles the new format.
Document Service API on the serverCustom back-end code that used the Entity Service API is affected, and the new response shape follows from how the Document Service returns entries.Confirm with your back-end team which controllers and services return data to the front end, and test those routes against the new format before go-live.

How the v4 compatibility header buys time

The Strapi-Response-Format: v4 header lets a client keep receiving the v4 response shape while the rest of your system moves to Strapi 5. A front end that still expects the attributes wrapper and numeric id can continue to work after the server upgrade, so the team can update the back end, the content workflows and each client on its own schedule. The header does one thing: it returns the old format. It does not change how Strapi 5 stores content, how the Document Service behaves or which fields the API exposes, so client code should still be tested against the Strapi 5 response shape before the header is removed.

In practice, the header belongs in each client's request configuration, such as a shared fetch wrapper, an HTTP client instance or a server-side data layer, rather than being added to individual calls. Set it once, then verify it endpoint by endpoint: send a request to each collection and single type the client uses, and confirm the response still has the attributes wrapper. Check nested relations and media fields separately, since a client can pass one endpoint and fail on a populated relation. Record which endpoints you checked and the response you received, so the verification can be repeated after each change.

Treat the header as temporary. Every client that sends it must be on a written inventory with its owner, repository, endpoints, and a target date for removal, because a header left in place becomes a permanent dependency on a format Strapi has moved away from. Confirm with your Strapi version and release notes how long the header is supported for your upgrade path before you set those dates, and make the inventory the list you work through when removing it client by client.

What to inventory before changing any client

Strapi 5 changes the REST response shape and replaces id with documentId, so every client that reads those fields is affected at once. Inventory the consumers, the code and the data first, so the switch can be planned client by client with a known rollback point.

Every consumer of the REST API

List every program that calls the Strapi REST API: browser apps, mobile apps, static site builds, server-side renderers, webhooks, scheduled jobs and internal scripts. Include calls made through a proxy, CDN edge function or preview environment. Record the endpoint paths, the release cadence and whether a rebuild is needed to pick up a change. Scheduled jobs and static builds are the consumers most often missed, because they do not show up in user-facing testing.

Response format docs

Code that reads attributes or id

Search each client for reads of the attributes wrapper, id used as a key or route parameter, and relation fields that assume the v4 nesting. Check URL construction, caching keys, local storage, analytics events and typed models generated from v4 schemas. Note which reads are on the response path and which only appear in admin tooling, because the first group breaks pages and the second breaks internal workflows.

Database backup before the upgrade

Take a full database backup before the Strapi upgrade starts and confirm that you can restore it onto a separate host. The migration documentation says to back up the database first because downgrading is not supported. Keep the upload folder or object storage state matched to that backup point, and record the Strapi version and Node.js version in use so the pre-upgrade state can be rebuilt if needed.

Staging copy with the header available

Run the upgraded Strapi on a staging copy of production data with the Strapi-Response-Format: v4 header available to the clients. Use it to compare old and new payloads side by side for each endpoint. Confirm that the staging data matches production closely enough to expose the content types, locales and relations your clients depend on. Keep staging on the same database engine version you plan to run in production.

Contract tests for key endpoints

Write contract tests that assert the response shape for the endpoints each client uses, including nested relations, components, dynamic zones and pagination. Run them against both the v4 header response and the default Strapi 5 response. Tests that pass on both prove the header only changed the format, while failures show exactly which field a client reads incorrectly. Keep these tests in the client repository so they run in that team's pipeline.

Named owner for each client

Assign one accountable owner to each client, including the team that deploys it and the person who can approve its release. Confirm who can rebuild static sites, who holds mobile store release rights, and who responds when a scheduled job fails. Agree on the order in which clients move and the date each client stops relying on the header. Ownership gaps are the most common reason a header removal gets delayed.

How to move clients off the v4 format one at a time

This sequence lets each front end switch from the v4 response shape to the Strapi 5 shape on its own schedule, so no client breaks while others are still reading the old format. Every release has a rollback point, and the Strapi-side header comes out only when no consumer depends on it.

  1. Upgrade Strapi on staging and confirm the header

    Upgrade a copy of production to Strapi 5 on a staging environment, using the upgrade tool and a database backup taken first. Then send the same REST requests with and without the Strapi-Response-Format: v4 header and compare the bodies. The step is done when the header-less responses show the flattened shape with documentId, and the header-based responses match the v4 payloads your clients already parse. Strapi downgrades are not supported, so keep the pre-upgrade database backup as the fallback for the whole sequence.

  2. Map each client's reads of attributes and id

    For every client, list each place it reads attributes, the id field, relation population or pagination metadata. Include mobile apps, static site builds, server-side renderers, scheduled jobs and third-party integrations, since they are easy to miss. Record which keys switch from id to documentId and which nested objects lose the attributes wrapper. The output is a written inventory per client that the team signs off before any code changes, and it becomes the checklist for the contract tests.

  3. Update one client against staging

    Pick one client, preferably the lowest-risk one, and change its data access code to read the flattened shape and documentId. Point it at the Strapi 5 staging instance with the header removed from its requests. Fix the mapped keys, and any cache keys or routes that use id as a lookup value. The step is complete when the client renders every content type it uses from staging without errors, and the diff is limited to the inventory items for that client.

  4. Run contract and end-to-end tests

    Run the client's contract tests against the staging API and the end-to-end suite against the rendered client. Contract tests should assert the field names, types and relation shapes from the inventory, so a missing attributes wrapper fails a build rather than a live page. Include draft and published reads if the client uses them. The step is done when both suites pass on the staging data, and any failure is either fixed or logged as a known gap that blocks release.

  5. Release that client with a rollback point

    Before releasing the client, record the version of the previous client build and confirm it can still reach the API. Release the updated client through its normal pipeline, with the Strapi side still sending the header for the other clients. Keep the previous build deployable so the team can roll the client back without touching Strapi. Because a Strapi downgrade is not supported, rollback at this point means reverting the client, not the CMS. The step is done when production traffic for that client shows no errors over the period the team agreed on.

  6. Repeat for each remaining client

    Work through the inventory one client at a time, applying the same inventory, update, test and release steps to each. Do not batch clients into one release, because a failure in one would block the others and make the cause harder to isolate. Track the status of every client in a single table that shows whether it reads the v4 or the Strapi 5 shape. The step is done when every client in the table is marked as reading the Strapi 5 shape in production.

  7. Remove the header after every consumer is confirmed

    Only after every client is confirmed on the Strapi 5 shape, and no other consumer such as a scheduled job or partner integration still depends on the header, remove the Strapi-Response-Format: v4 handling from the Strapi side. Deploy the change to staging first and rerun the full contract suite for each client. The step is complete when all suites pass without the header and the team has recorded the date and the confirmed consumer list. Ask the vendor or your own environment to confirm any consumer you cannot test directly before this change.

How different front ends need to change

Single-page and server-rendered web apps are the most controllable clients because you deploy them yourself and can release the front end and the CMS in a planned order. Most of the work sits in the data layer: API helper functions, fetch wrappers, typed response models and any code that reads attributes or uses id as a route key. Server-rendered apps also cache pages, so a format change can surface in cached HTML long after the deploy.

  • Data access layer: Find every place that reads data.attributes and move it to top-level fields, so one helper change covers most pages.
  • Identifiers: Replace id used for routing, cache keys or relations with documentId where the Strapi 5 response provides it.
  • Bridge period: Send the Strapi-Response-Format: v4 header from the front end while the code is being converted, then remove it once the new shape passes tests.
  • Caching and ISR: Purge rendered pages or cache entries built from old responses so stale v4 shapes do not persist after release.
  • Release order: Deploy the front end that understands both shapes before the CMS switch, or keep the header in place until both are live.

Before release, run end-to-end tests on detail pages, lists, relations and preview mode in a staging copy of the Strapi 5 project.

What makes front end updates take longer

This table compares the factors that expand the front end work of moving to Strapi 5's flattened responses and documentId. Read each row as a question to answer about your own clients before estimating effort, and note which mitigations you can start before the upgrade. The main takeaway is that the number of clients matters less than how deeply each one depends on the old response shape.

DriverWhy it adds effortWhat reduces it
Number of clients and release cadenceEach web, mobile, or service client has its own code, build, and release schedule, so every one must be changed and verified separately.Inventory every client and its release process first, then order them so the simplest ones move early.
Use of id as a stored key or URL parameterCode that saves numeric id values or builds URLs from them must switch to documentId, and stored values may need a mapping.Search for id references in code and databases, and map old ids to documentIds before changing routes.
Deep nested populate and component readsNested populate chains and component or dynamic zone reads change shape at every level, so one missed path can break a whole page.List every populate query per screen and test each nested path against a v5 staging instance.
Custom code that parses the attributes wrapperHelpers that read data.attributes or walk attribute objects will fail silently or return undefined after the flattened format arrives.Centralize response parsing in one adapter layer so the change happens in one place.
Mobile clients on older app versionsInstalled apps cannot be forced to update, so the backend may need to serve both formats while old versions remain in use.Confirm the minimum supported app version with the mobile team and keep the v4 header available until that version is retired.
Third-party consumersPartners, scripts, and integrations you do not control may read the attributes wrapper or id and will break without notice.Identify every external consumer from access logs and notify each owner before the switch.
No automated contract testsWithout tests that check response shape, teams find breakage by manual testing or from users, and every change needs a full manual pass.Add contract tests for key endpoints that assert documentId and flattened fields, then run them against both formats during the switch.

How clients move from the header to the flattened format

The path starts with Strapi 5 running on staging with the Strapi-Response-Format: v4 header still applied, so every existing client keeps receiving the old wrapped shape. Each front end is then switched to read flattened responses and documentId, tested on its own, and released. Only when every client is confirmed does the team remove the header on the server. If a client release fails, it is rolled back to the header-enabled configuration while the other clients keep running. Check each client against the same staging data before its release, and confirm that no client still reads attributes or id before the header comes off.

Phases for switching front ends from the v4 header to the flattened response format.

Questions teams ask about the Strapi 5 response change

How much does updating front ends for the Strapi 5 response change cost?

The cost depends mainly on how many front ends and API consumers read Strapi content, how many endpoints and components each one uses, and how much of the code already isolates the data layer. Each client pays for its own change, so a team with one website and one mobile app has a very different bill from a team with five channels. Ask any partner for a quote that lists each client, each endpoint family, the work to switch from the attributes wrapper and id to flattened fields and documentId, and the regression tests included. Expect the quote to separate one-time code work from any recurring support you choose to add later. DeployOpen quotes follow from the written scope, and we do not publish prices.

How long does the front end switch take, and what sets the pace?

The pace is set by the number of clients, how many places in each client depend on the old shape, and how quickly your release process can ship each one. The header-based approach lets you move clients one at a time while the rest keep working, so the slowest client, usually a mobile app with its own store review, often defines the finish date. No fixed duration applies to every project, so ask for a timeline that shows each client as a separate release with a cut-over date. Strapi's v4 end of life date of April 30, 2026 is a fixed fact in the migration docs, and your plan should reflect that the v4 format is a transition aid, not a permanent contract.

What does the internal team need to provide for this work?

The internal team needs to supply the people who know each front end, the access to its repositories and deployment pipelines, and a decision owner who can approve the release order. Someone must also own the list of Strapi endpoints each client calls, including custom routes and any GraphQL usage, because missed calls are the most common cause of regressions. Expect to provide a staging Strapi instance that mirrors production content, and a way to test against it. Mobile release schedules, feature freezes and app store review windows also need to be shared early so the plan reflects them.

Can our own developers handle the front end switch without outside help?

Yes, if your developers already know the front end framework, can read the Strapi 5 breaking change notes, and have a test suite that exercises the content they render. The work is usually straightforward per field but tedious across many components, and it is easy to miss nested relations, media fields and pagination metadata. Outside help is most useful when several clients must change together, when no one owns the API contract, or when releases must be coordinated across mobile and web. Whichever path you choose, ask for a written list of the clients, endpoints and tests that define done.

Can we keep the Strapi-Response-Format v4 header permanently?

Not as a long-term plan. Strapi documents the Strapi-Response-Format: v4 header as a way to return the old format during migration, and Strapi 4 reached end of life on April 30, 2026, so the header is meant for the transition window. Keeping it indefinitely means every client still depends on the old shape, the team keeps two response contracts in mind, and any future Strapi change compounds the debt. Plan to remove the header client by client, and confirm with your Strapi version and release notes that the header still behaves as expected for the version you run.

How do we handle mobile apps that cannot be updated all at once?

Mobile apps already in users' hands keep calling the API they were built against, so the server must keep serving the old format to those builds until they are replaced. A practical pattern is to ship the updated app to the store first, set a retirement date for old builds, and keep the v4 header on the endpoints those builds use until adoption is high enough for your business. Because app store review and user update rates are outside the server team's control, record which app versions call which endpoints so you can decide when the header can be removed. Confirm the store review and release timelines with your mobile team before fixing any date.

How do we confirm the front ends work after the switch?

Start with contract tests that check each endpoint's response shape against the flattened Strapi 5 format and the documentId field, then run end-to-end tests on the pages or screens that display the content. Add a comparison run against staging where the same request is sent with and without the v4 header, so differences are visible before a client is switched. Include relations, media, localized content, drafts where editors preview content, and error responses. Ask for test results per client and a sign-off step before each header removal, not a single test run at the end.

What a DeployOpen front end migration covers

A DeployOpen front end migration starts with an inventory of every consumer that calls your Strapi API: the Next.js, Nuxt, Astro or mobile apps, scheduled jobs, webhook receivers, search indexers and third-party scripts that read responses today. For each one, the work records which endpoints it calls, which attributes wrapper paths it reads, every place it uses id as a lookup key or relation pointer, and whether it stores those ids outside Strapi. That map turns into a mapping sheet showing where documentId replaces id, where nested data now sits one level higher, and which fields need null-handling changes. Client code changes follow, with unit and contract tests run against both response shapes while the header is still in use. Each change is delivered inside your own cloud accounts, repositories and CI pipelines, so no response data leaves your environment for the migration itself.

Releases are staged. DeployOpen ships each client behind a flag or a version switch, confirms the Strapi-Response-Format: v4 header is no longer needed by that client, and removes the header from the client's requests in a separate, reviewable change. Scope is agreed in writing before work starts and lists the consumers included, the endpoints covered, the test environments, the release steps and any clients that stay on the header for a planned period. DeployOpen does not publish a price list. The quote follows from that written scope, so the number of consumers, the amount of nested or relation-heavy data, the number of stored identifiers that need rekeying and the test coverage you already have are the main inputs. Ask for each cost component to be listed separately, and confirm with your team whether any consumer belongs to a vendor you cannot change.

How DeployOpen works on this

DeployOpen scopes the front end side of a Strapi 5 move as its own piece of work, separate from the back end upgrade. We inventory every client that reads the REST API, plan the switch from the v4 response format to the flattened Strapi 5 format and documentId, and build and test each client against a copy of the project before anything reaches production.

How we scope

  • We list every front end, script, mobile app and third-party consumer that calls the Strapi REST API.
  • We record which fields read the attributes wrapper or id, and which use the v4 response shape.
  • The written scope sets the clients in and out of work, the environments covered and the retest criteria before engagements are fixed-scope.

How we build

  • We set the Strapi-Response-Format: v4 header per client during the switch so each one can move on its own schedule.
  • We update data access code to read flattened fields and use documentId for content lookups and updates.
  • We test each client against staging content, including draft and published states, and record the results against the agreed scope.

How we hand over

  • We deliver a per-client record showing when the v4 header was removed and which tests passed afterward.
  • We document the remaining v4 dependencies so your team can see what is still on the old format.
  • We walk your developers through the changed fields, identifiers and the removal steps for future clients.

How we support

  • Ongoing support, upgrades and continuous testing are available as retainers for clients that keep changing their front ends.
  • A retainer can cover retesting each client after Strapi minor releases that touch the REST API.
  • Ask any partner to confirm in writing which front end teams, environments and tests the support covers.

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.