Skip to content
  1. Extras
  2. mxHeadless
  3. API
  4. Resources and Pages

Resources and Pages ​

Resources ​

MethodPathPublic readScope
GET/resourcesyesresources.read
GET/resources/{id}yesresources.read
POST/resources-resources.create
PUT / PATCH/resources/{id}-resources.update
DELETE/resources/{id}-resources.delete
bash
curl -s 'https://example.com/api/v1/resources?limit=5&filter[published]=1&fields=id,pagetitle,uri'

Delete is soft by default. ?force=1 removes the resource permanently. Restore with PATCH deleted: 0, ?include_deleted=1, and the matching permissions.

Pages ​

MethodPathPublic readScope
GET/pages/{uri}yesresources.read

{uri} is the path without a leading /. Do not encodeURIComponent the whole path. You may encode each segment. %XX encoding is decoded.

RequestURI candidates
/pages/aboutabout, about.html, about/
/pages/about.htmlabout.html, about
/pages/blog/postblog/post, blog/post.html, blog/post/
/pages/indexindex.html, index, empty URI

In meta: uri (as requested), resolved_uri (matched MODX URI), context.

bash
curl -s 'https://example.com/api/v1/pages/about' \
  -H 'X-Context: web'

Query ​

Parameters from Querying: filter, sort, fields, limit/offset/page, include.

TVs, media, and relations ​

TV values on a resource: ?tv_fields=name1,name2 or include=tvs (no list → all TVs). TV definitions: GET /tvs, not resources fields. Resource relations: include=parent,children. Details are in /schema.

File paths in resource fields become absolute URLs through MODX media sources (MediaUrlResolver). Relative paths use site_url and the active context. Values starting with http:// or https:// are unchanged.