Storing plugin data with content types and server APIs

Plugin content types, routes, controllers and services decide where your data lives and who can reach it. This page covers the decisions, build sequence and handover for a Strapi 5 plugin that stores its own data.

On this page

When a Strapi plugin needs its own content types and server APIs

A Strapi plugin needs its own content types and server APIs when it must store records that do not belong to the application's content model, expose them through server routes, and show them in the admin panel. Strapi 5 supports this pattern, but the design choices made at the start (how records are modeled, which routes are public, how controllers and services split the work, and what the admin panel receives) are costly to change once other projects depend on the plugin. This section sets out what the rest of the topic covers: plugin content types, routes, controllers, services, lifecycle phases and the path that moves data from the server to the admin panel. It also helps you decide whether your own team or an implementation partner should own that design.

The runtime sets the limits before any code is written. Strapi 5 supports PostgreSQL 14 or later, MySQL 8.0 or later, MariaDB 10.3 or later and SQLite 3, and it does not support MongoDB or other NoSQL databases. It runs only on Active or Maintenance LTS Node.js versions, so confirm the Node.js version your CI and production images use before the plugin is designed around it. Plugin code reads and writes data through the Document Service API, which replaces the Entity Service API from Strapi 4. Teams that inherited v4 plugin code should expect this layer to differ from what they know.

Bring in a partner when the plugin will serve several projects, when records carry personal data or audit requirements that the plugin must satisfy, or when the team has not yet built a Strapi 5 plugin that survives upgrades. Ask any candidate to show how they will keep the plugin's data model, route permissions and admin data contracts stable across Strapi minor releases, which have shipped roughly weekly in 2026. Ask how they will test a plugin against the supported database and Node.js matrix, and who signs off on schema changes once records exist in production. A written scope should name the content types, the routes that expose them, the permission checks each route applies and the fixtures or migrations needed to test them.

If you build the plugin in-house, assign one owner for the data model and one for the admin contract, and record both decisions before the first content type is created. Strapi's own documentation on the v4 to v5 migration and the installation requirements is the natural first read for your engineers, because it fixes the version and database assumptions the rest of the design depends on.

What a Strapi 5 plugin can do with its own data

A plugin that stores its own data works through a small set of server-side parts: content types, routes, controllers, services and lifecycle hooks. Each part has a clear job, and the boundaries between them decide where validation, permissions and side effects end up. The cards below cover each part and the checks to make before writing plugin code.

Plugin content types and schema files

A plugin defines its own content types in schema files that Strapi reads when the plugin loads, so its data gets a table, fields and an entry shape of its own. Decide early whether the data belongs in a plugin content type or in an application content type, because that choice affects who can edit it, how it is migrated and whether other projects can reuse it. Check the schema against the database you run, and confirm how schema changes are applied on existing installations before shipping a version.

Strapi docs

Routes that expose plugin endpoints

Routes map HTTP methods and paths to controller actions, and they are where a plugin declares which endpoints exist. Each route should state its authentication requirement and its permission check explicitly, since a route left open by default is the most common way plugin data leaks. Review every route against the Users and Permissions settings in a test app with a non-admin account before release.

Controllers that handle requests

Controllers receive the request, read input, call services and return the response. Keep them thin so that business rules live in one place and can be tested without an HTTP layer. Verify that controllers validate input and do not return raw database records that include fields the caller should not see, since controllers are the last checkpoint before data leaves the server.

Services that hold business logic

Services contain the logic that reads and writes plugin data, and they are the right place for calculations, data shaping and calls to other plugins. Because controllers and lifecycle hooks can both call the same service, one service keeps behavior consistent across the API and background writes. Ask whether each service function reads or writes through the Document Service API so that it follows Strapi 5 data handling.

Lifecycle hooks around writes

Lifecycle hooks run code before or after records are created, updated or deleted, which makes them useful for audit trails, derived fields and cleanup. They also run for writes that come from other code paths, so a hook can fire more often than the team expects. Document every hook, keep the work inside it short, and test what happens when a hook fails partway through a write.

Passing plugin data to the admin panel

Admin pages read plugin data through the server routes the plugin exposes, so the admin panel is another client of the same API and needs the same permission checks. Confirm which admin permissions gate each plugin route, and test the page with an editor role that lacks those permissions. Plan the response shape with the admin team so that the panel does not depend on fields that a later server change might remove.

Which storage and API decisions to make before writing code

This table compares the storage and API choices a plugin team makes before writing code, with the option, when it fits and the risk it carries. Read each row as a decision to settle with the people who will own the data, and confirm permission defaults against the current Strapi docs before you rely on them.

DecisionOptionWhen it fits and the risk it carries
Where the data livesPlugin content typeFits data that belongs to the plugin and should ship with it. Risk: editors cannot model relations to core types as freely, and uninstalling the plugin can strand the data.
Where the data livesCore content type in the appFits data editors manage alongside existing content and reuse in the Content Manager. Risk: the plugin then depends on a schema the project owns and may change.
Route exposureAdmin-only routesFits internal tools, settings and dashboards used by editors. Risk: low external exposure, but admin tokens and roles must be scoped correctly.
Route exposurePublic content routesFits data that front ends must read without login. Risk: anything exposed becomes readable, so confirm public permission defaults in the current docs.
Logic placementBusiness logic in servicesFits rules reused by controllers, lifecycle hooks and other plugins. Risk: services with hidden side effects are hard to test if they reach into global state.
Logic placementThin controllers that validate and delegateFits most request handling, keeping HTTP concerns separate from rules. Risk: controllers that accumulate rules become the only place a rule exists.
Data accessDocument Service API directlyFits teams on Strapi 5 who want the current supported model and full control. Risk: calls scattered across the plugin make a later Strapi change expensive to absorb.
Data accessThin wrapper around the Document Service APIFits plugins that must run across several Strapi releases or share one data access path. Risk: the wrapper can hide permission checks if it is not written carefully.

Build sequence for plugin data, route and admin delivery

This sequence takes plugin data from a schema decision to a verified admin panel view. Each step produces a checkpoint you can inspect before the next one starts, so problems surface while changes are still cheap to make.

  1. Model content types and confirm the database target

    The plugin developer defines the content types the plugin owns, their attributes, relations and any draft and publish behavior, then confirms the database the target Strapi project runs on. Strapi 5 supports PostgreSQL, MySQL, MariaDB and SQLite, but not MongoDB or other NoSQL databases, so the schema must be designed for a relational store. Done means the schema files are committed, reviewed against the editor workflow, and the database choice is written down for the test app and for every customer environment.

  2. Build the service layer on the Document Service API

    The developer writes services that read and write plugin data through the Document Service API, which replaces the Entity Service API used in Strapi 4. Business rules, validation and calls to other services live here rather than in route handlers, so they can be tested without HTTP. Done means the service functions run against the test app with unit tests that cover create, read, update, delete and the failure paths, and no service code calls the deprecated Entity Service.

  3. Add controllers, routes and permission checks

    The developer maps each plugin endpoint to a controller action, keeps controllers thin by calling services, and attaches policies that check the caller's permissions for every route. The route map lists method, path, action, the permission required and whether the route is public or admin-only. Done means the route map is complete, no endpoint is reachable without an explicit policy decision, and requests with missing or insufficient permissions return the expected denial in a test run.

  4. Wire lifecycle hooks and side effects

    The developer registers lifecycle handlers for the plugin's content types, such as logic that runs before or after create, update or publish, and places any audit, notification or sync work there. Hooks should call the same services as the routes so behavior does not diverge between admin edits and API writes. Done means each hook has a test showing it fires once per operation, that it does not trigger recursive writes, and that failures are logged with enough detail to trace them.

  5. Expose plugin data to the admin panel

    The developer connects the admin panel to the server routes through the plugin's admin API client, handles loading, empty and error states, and passes only the fields the admin view needs. Permission-gated data must be requested through the same checks as the server. Done means a logged-in admin with the right role sees the expected records in the plugin page, a user without the role gets a denied state, and the request and response shapes match the route map.

  6. Verify the end-to-end data flow in the test app

    The developer runs the plugin against a test Strapi app connected to the chosen database, then checks the full path from an admin action through the route, service, hook and database back to the admin view. Confirm the flow after a fresh install and after a restart so migrations and seeded data behave as expected. Done means a recorded checklist shows each route, role and hook exercised, with any gaps logged as open items before the plugin moves to customer environments.

How server data reaches the admin panel

When an editor opens a plugin page in the admin panel, the request leaves the React admin code, reaches the plugin's server routes, and is handed to a controller. The controller checks input and permissions, then calls a service. The service reads or writes the plugin's content types through Strapi's Document Service API, which talks to the database that the Strapi project is configured to use. The response travels back along the same path, and the admin panel renders whatever shape it receives. Each hop is a place where data can change, so a plugin team should trace one real request end to end in a test app and write down which function owns each field before the admin code is written.

The response shape is the main compatibility risk for a plugin built on Strapi 5. The Strapi v4 to v5 migration docs state that Strapi 5 replaces the Entity Service API with the Document Service API and changes the API response format, and that a Strapi-Response-Format: v4 header is available for backward compatibility during migration. A plugin that returns raw Document Service results to the admin panel, or that depends on v4 field names such as nested attributes objects, can break silently when a field is renamed or nested differently. Confirm the header behavior against the version of Strapi you target, because the docs describe it as a migration aid rather than a permanent contract.

Test responses against Document Service behavior, not against assumptions about the old API. Write tests that call the plugin route, assert the exact JSON the admin panel consumes, and cover draft and published versions, relations, and empty results. Run the same tests on every Strapi minor release your plugin supports, since Strapi 5 minor versions ship frequently. Ask your plugin developer to name the Strapi versions the tests cover and to show the test output. A check that the admin page still renders after a Strapi upgrade is a useful final gate, but it does not replace contract tests on the server response.

How plugin data flows from admin to database

The request starts in the admin panel running in the browser, which is outside the trust boundary. It calls a plugin route, where the server checks policies before the controller runs. The controller hands work to a service, which calls the Document Service API to read or write content, and the database stores the result. The response returns along the same path, so check that every write passes the policy and permission checks before it reaches the data layer.

Request path from the admin panel through the plugin server to the database.

What drives the effort of plugin data work

This table lists the factors that raise or lower the effort of defining plugin content types, server APIs and admin data flows. Read each row as a lever: the middle column explains how it changes the work, and the right column names the habit that keeps it manageable. The main takeaway is that schema scope, permission design and the Strapi version target usually matter more than the amount of code.

DriverWhy it changes effortHow to keep it down
Number and relations of content typesEach plugin type adds a schema, a service, routes and admin screens, and every relation adds query and cascade behavior to test.Store only data the plugin must own, reference existing Strapi content by ID, and limit relations to those the admin screens actually use.
Custom validation and lifecycle logicLifecycle hooks and validators run on every create, update and delete, so bugs there affect imports, the API and the admin panel at once.Keep hooks small, move business rules into services, and write tests for each lifecycle phase, including bulk and nested writes.
Permission model complexityEach controller action needs a permission check, and plugin actions must line up with the roles administrators assign in the admin panel.Define a small set of plugin actions up front, map each one to a role, and verify access with a non-admin test account.
Admin UI depthForms, list views and detail pages that read plugin data add components and state handling on top of the server API contract.Start with list and edit views, reuse the Strapi design system components, and delay custom widgets until the data model is stable.
Strapi version targetsSupporting Strapi 5 only is simpler than covering several releases, because server and admin APIs can change between minor versions.Confirm the minimum Strapi 5 release you will support, pin it in the plugin's peer dependencies, and test against the newest 5.x release before each update.
Database choiceData types, migrations and query behavior differ across PostgreSQL, MySQL, MariaDB and SQLite, so a plugin tested on one may fail on another.Run the test suite on each database you intend to support, and confirm the supported versions listed in the Strapi installation requirements.
Test coverageWithout tests for services, controllers and permissions, every Strapi release or content model change becomes a manual regression pass.Write service tests against a test database, controller tests for each route, and one end-to-end check that data appears in the admin panel.

How plugin data connects to the rest of the platform

A plugin's content types and server routes do not operate alone. They sit beside end-user authentication, administrator sign-in, the core content model, the upgrade path and any outside system that calls them. Each connection below names what it needs from your team and what to confirm in the current docs before design is fixed.

End-user access through Users and Permissions

Plugin routes that serve public or logged-in visitors rely on the Users and Permissions plugin for end-user identity and role-based route access. Decide which plugin routes are public, which need an authenticated user, and which should only be reachable by server-to-server calls. Confirm how the current docs define route permissions and token types for each of these cases, and test each route with an unauthenticated and an authenticated request before go-live.

Strapi SSO docs

Administrator sign-in and editor roles

Admin SSO covers only administrator login to the admin panel. It does not authenticate end users of your plugin's public routes. Plan which identity provider signs in editors, what default role new accounts receive, and whether local login stays available as a fallback. Map each plugin admin permission to a role an editor actually holds, and confirm with the current docs which SSO features require the Growth or Enterprise plan.

Strapi SSO docs

Core content types and relations

A plugin's collections often point at core Strapi content types through relations, or read entries that editors manage in the core model. Changes to those core types can break plugin queries and admin views. Document every core type the plugin reads or writes, the fields it depends on, and the owner of each schema change. Review the current content modeling guidance before adding relations to types you do not control.

Strapi version and upgrade path

Plugin code depends on Strapi APIs that changed between major releases. Strapi 5 replaced the Entity Service API with the Document Service API and changed the response format, and Strapi v4 reached end of life on April 30, 2026. Confirm which Strapi major version your plugin targets, pin the supported version range, and check the migration docs and breaking changes list before any upgrade. Back up the database first, because downgrading is not supported.

Migration FAQ

External systems calling plugin routes

Partner systems, scheduled jobs and front ends that call plugin routes need their own credentials, rate expectations and error handling. Decide whether each caller uses an API token, a user token or a server-side integration, and what scope each token receives. Confirm the current token and route permission model in the docs, then test that a revoked or narrowly scoped token cannot reach routes outside its purpose.

Database and runtime requirements

Plugin tables run on the same database as the core Strapi schema, so the supported database and Node.js versions set the limits for your design. Strapi 5 supports PostgreSQL 14 or later, MySQL 8.0 or later, MariaDB 10.3 or later and SQLite 3, and does not support MongoDB. It runs only on Active or Maintenance LTS Node.js versions. Confirm these requirements against the installation page for the exact release you deploy.

Installation requirements

Questions teams ask before storing plugin data in Strapi

How much does a plugin data implementation cost?

No price is fixed for this work, and DeployOpen does not publish a price list. The quote follows from the written scope, which depends on how many content types the plugin stores, how many server routes and services it exposes, whether the admin panel reads the data, and how much existing data must be handled. One-time costs cover design, build, testing and handover. Recurring costs cover the Strapi plan you run and any retainer for upgrades. Ask for the quote to separate build effort from hosting, and to list each content type, route and admin screen as its own line. The Strapi self-hosted plans are published on the Strapi self-hosted pricing page: Community is free, Growth is listed at 45 US dollars per month including 3 users, and Enterprise is custom priced. Plan choice affects features such as SSO and audit logs, so confirm which features the plugin depends on before comparing costs.

How long does it take to build plugin data storage?

Duration depends on the number of data models, the complexity of the server logic, and how many admin screens must read or write the data. A plugin with a few simple content types and read-only routes is far less work than one with relations to core content, lifecycle hooks, permission checks and bulk operations. The written scope should list phases with a deliverable for each: data model review, server API build, admin data view, tests against a test app, and handover. Ask for a timeline tied to those deliverables and for the Strapi version range the plugin must support, because supporting several Strapi 5 releases adds verification work. Strapi 5 minor releases have shipped roughly weekly, for example v5.56.0 on September 30 and v5.57.0 on October 7, 2026, according to the Strapi GitHub releases page, so the target version should be fixed in the scope.

What does the client team need to provide?

Your team provides decisions and access, and DeployOpen does the build. Expect to supply the business rules the plugin must enforce, sample data that reflects real records, the list of editors and roles who will use the data, and a test Strapi application connected to a supported database. Supported databases for Strapi 5 are PostgreSQL 14 or later, MySQL 8.0 or later, MariaDB 10.3 or later and SQLite 3, and MongoDB is not supported. Node.js must be an Active or Maintenance LTS version. Also name a reviewer who can approve data model changes, because renaming a field after editors have entered content is costly. Ask the scope to state who signs off each phase and how many review rounds are included.

Can an in-house developer build a plugin that stores data?

Yes, if the developer knows TypeScript or JavaScript, Strapi's plugin structure and how content types are registered. Plugin data work touches the schema, the server routes, controllers and services, and the admin panel, and each part fails in its own way. An in-house team usually needs time to learn the Strapi 5 Document Service API, which replaced the Entity Service API, and to set up tests that run against a real Strapi application. Check whether the team has done this before on Strapi 5 specifically, since older examples often use the v4 APIs. A partner is most useful when the team has a deadline, no one has built a plugin before, or the plugin must pass a security review. Ask the partner to name which parts it hands over and which skills the internal team should own afterward.

Can plugin data be migrated later if the design changes?

Usually yes, but the cost rises with the amount of stored data and the number of places that read it. Content types define tables in the database, so changing a field name, type or relation means writing a migration that moves existing rows safely. Strapi's own upgrade tooling covers moving from v4 to v5, but it does not replace a plugin-specific migration. Before any schema change in production, back up the database, because the Strapi v4 to v5 migration docs say downgrading is not supported. Ask the scope to include a migration plan for each schema change, a rollback procedure for the staging environment, and a list of which API consumers will break if a route changes.

How do Strapi 5 upgrades affect a custom plugin?

Upgrades affect a plugin through changed APIs, changed response formats and changed admin internals, so each Strapi minor release needs a regression check. Strapi 5 minor releases ship roughly weekly, so plan a fixed upgrade window rather than tracking every release. Ask the plugin to pin a tested Strapi version range, run its test suite against each target release, and document which features it depends on, such as Document Service calls and admin extension points. Strapi publishes release notes on GitHub, and each release should be read before the plugin is moved forward. A retainer for upgrades and continuous testing is available from DeployOpen, and its scope should name the Strapi versions covered and the response time for fixes.

Does storing plugin data affect security and access control?

Yes. Every route the plugin exposes is reachable only as far as its permissions allow, so each controller needs explicit checks for who can read, create, update or delete records. Admin access is separate from end-user access: SSO in Strapi applies to administrator login, while end-user authentication is handled by the Users and Permissions plugin. Review the plugin's public routes before go-live, confirm that stored data does not expose secrets, and log changes where your compliance team requires an audit trail. Audit logs are an Enterprise feature in Strapi's self-hosted plans, so confirm the plan supports the logging you need. Ask for the security review to be part of the written scope rather than a later addition.

How DeployOpen scopes and delivers Strapi plugin data work

DeployOpen starts plugin data work with a written scope agreed before any build begins. For a plugin that stores its own data, that scope names each content type, its attributes and relations, the routes each one exposes, which controllers and services handle them, and which lifecycle phases must run. It also records the admin screens that read and write this data and the roles allowed to use them. Because most engagements are fixed-scope, deliverables and timelines are settled in this document, so the client's team can check the design against its own data policy before code exists. DeployOpen is a Chainscore Labs company, and the work runs inside the client's own infrastructure: their cloud accounts, data centers or air-gapped networks, with the database and Strapi version the client has approved.

During the build, DeployOpen implements the content types, services and routes, then wires the server-to-admin data flow through the admin API so that the admin panel reads only what the scope allows. The client's team should confirm early which Strapi release and Node.js line the plugin targets, which database engine is in use, and whether the plugin will rely on the Document Service API. Each of these choices changes how services are written and tested. Deliverables include the source repository, a test app configuration, and a written record of the content types, routes, controllers, services and permission checks, so engineers who inherit the plugin can trace any stored field back to its owner.

Documentation is handed over with the code. It covers the data model, the route list with its permission checks, the lifecycle behavior, and the steps needed to verify a change against a test app. DeployOpen also offers retainers for upgrades and continuous testing. Strapi releases move quickly, so a plugin that stores data needs regular checks against each target version, and a retainer lets the client's team keep that work scoped and tracked without rebuilding the plugin each time. Ask any provider for the exact retest steps, the versions covered, and what the quote includes before signing.

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.