
- MODX 3
- PHP 8.1


Via modstore.pro (provider https://modstore.pro/extras/, email and API key from your account) find and install mxHeadless. Or build the transport:
cd _build
php build.phpIn Manager: Packages → Install Package → upload the .transport.zip.
Clear the MODX cache. Details: Installation.
Enable friendly URLs. Requests to /api/v1/* must reach MODX index.php. Rules: Web server.
Without rewrite:
curl -s 'https://your-site.example/assets/components/mxheadless/api.php?route=/v1/health'curl -s https://your-site.example/api/v1 | jq
curl -s https://your-site.example/api/v1/health | jqDiscovery returns the package version and a capability snapshot. Health checks the database.
curl -s 'https://your-site.example/api/v1/resources?limit=5&filter[published]=1' | jqPublic reads on resources and pages work without a key. Elements, contexts, and most objects require authentication.
Open /api/v1/docs in a browser or fetch the spec from /api/v1/meta/openapi.json. Details: Swagger and OpenAPI.
In Manager: Components → mxHeadless (requires mxheadless_apikeys) or CLI:
php core/components/mxheadless/bin/api-key-create.php --name=ci --scopes=resources.read,chunks.readThe secret is shown once. Then:
curl -s https://your-site.example/api/v1/chunks \
-H 'Authorization: Bearer mxh_...'