
- MODX 3
- PHP 8.1


mxHeadless targets MODX Revolution 3.2.3+ and PHP 8.1+.
If the transport is encrypted, installation fails with Package provider not found unless the provider is configured.
https://modstore.pro/extras/The installer creates namespace mxheadless, the OnHandleRequest plugin, menu, system settings, tables, and the mxheadless_apikeys permission.
Build from source or download a release from GitHub:
cd _build
php build.phpIn Manager: Packages → Install Package, upload the .transport.zip.
Finish installation and clear the cache.
Setting keys moved from dots (mxheadless.cors.enabled) to underscores (mxheadless_cors_enabled). The upgrade resolver copies values and removes the old rows. Clear the MODX cache after upgrade.
New setting mxheadless_context (default web): bootstrap context for the gateway and api.php. Value mgr is ignored.
Copy or mount core/components/mxheadless/ into your MODX install:
cd core/components/mxheadless
composer install --no-dev --optimize-autoloaderVerify namespace mxheadless under System → Namespaces.
OnHandleRequest plugin Default prefix: /api (mxheadless_api_prefix). Requests to /api/v1/... are handled by the package application.
| Setting | Default | Purpose |
|---|---|---|
mxheadless_api_prefix | /api | URL prefix before /v1 |
mxheadless_context | web | MODX bootstrap context for the API. mgr is ignored |
mxheadless_enabled | true | Kill switch |
mxheadless_debug | false | Verbose errors (dev only) |
api.php Without friendly URLs. With PATH_INFO:
https://your-site.example/assets/components/mxheadless/api.php/v1/healthOn nginx/Herd (often no PATH_INFO for nested .php), use query route:
https://your-site.example/assets/components/mxheadless/api.php?route=/v1/health
https://your-site.example/assets/components/mxheadless/api.php?route=/api/v1/resources&limit=5Bare api.php serves discovery. Both entry points share the same middleware pipeline.
| Item | Details |
|---|---|
| Tables | mxheadless_api_keys, mxheadless_oauth_clients, mxheadless_oauth_tokens, mxheadless_webhook_subscriptions, mxheadless_webhook_deliveries, mxheadless_api_log |
| Permission | mxheadless_apikeys (default for Administrator) |
| Menu | Components → mxHeadless |
| Event | OnMxHeadlessRegister |
Enable friendly URLs. You do not need a separate MODX resource for the API. Behind a load balancer, configure trusted proxies.
curl -s https://your-site.example/api/v1 | jq
curl -s https://your-site.example/api/v1/health | jq
curl -s 'https://your-site.example/api/v1/resources?limit=5&filter[published]=1' | jq