
- MODX 3
- PHP 8.1


REST API gateway for MODX Revolution 3. Exposes resources, pages, elements, contexts, and registered xPDO objects as JSON for Nuxt, Next.js, SvelteKit, mobile apps, and custom clients.
Release 1.0.42. License GPL-2.0-or-later, no feature tiers.
Source: Ibochkarev/mxHeadless.
/api/v1 prefix via the OnHandleRequest plugin (configurable)/api/v1/docsmxh_*), OAuth (mxt_*), Manager sessionOnMxHeadlessRegister) for MiniShop3 and custom extras| Version | |
|---|---|
| MODX Revolution | 3.2.3+ (transport declares modx >= 3.0.0, follow the package README) |
| PHP | 8.1+ |
| Database | MySQL / MariaDB (InnoDB), xPDO 3 |
Details: Requirements.
Install via modstore.pro in Package Management, or build the transport from source:
cd _build
php build.phpNext: Installation, Web server, Quick start.
https://your-site.example/api/v1curl -s https://your-site.example/api/v1 | jq
curl -s https://your-site.example/api/v1/health | jqInteractive spec: /api/v1/docs. Details: Swagger and OpenAPI.
Fallback without rewrite: assets/components/mxheadless/api.php?route=/v1/health.
Success:
{
"data": {},
"meta": {
"total": 100,
"count": 20,
"limit": 20,
"offset": 0,
"has_more": true
},
"links": {
"self": "/api/v1/resources?limit=20&offset=0",
"next": "/api/v1/resources?limit=20&offset=20"
}
}Errors: RFC 9457 (application/problem+json). See Errors.
An object appears in the API only after registration in ObjectRegistry with explicit fields, filters, and permissions. The URL name (resources, products) always maps to an ObjectDefinition, not an arbitrary PHP class. QueryParser accepts only fields, filters, and sorts from the definition.
mxApi is a transport and registry for third-party endpoints. mxHeadless ships resources and registered objects with a fixed envelope and live OpenAPI. Both packages can run on different prefixes.
| Topic | Link |
|---|---|
| Quick start | quick-start |
| System settings | settings |
| Authentication | authentication |
| Resources | api/resources |
| Swagger and OpenAPI | api/swagger |
| MiniShop3 | extensions/minishop3 |
| Webhooks | operations/webhooks |