Skip to content
  1. Extras
  2. mxHeadless
  3. API
  4. Objects

Objects

Generic CRUD for objects from ObjectRegistry. The URL name is a logical name (products, orders), not a PHP class.

MethodPathScope
GET/objects/{name}{name}.read
GET/objects/{name}/{id}{name}.read
POST/objects/{name}{name}.create
PUT / PATCH/objects/{name}/{id}{name}.update
DELETE/objects/{name}/{id}{name}.delete

The pattern is fixed in RoutesRegistrar: {name}.{action}. Not objects.{name}.read.

bash
curl -s 'https://example.com/api/v1/objects/products?limit=10' \
  -H 'Authorization: Bearer mxh_...'

Registry

An object appears in the API only after registration via core bootstrap or the OnMxHeadlessRegister event. See Extensions.

Unregistered name → 404.

MiniShop3

Typical names: products, categories, orders, … Orders are usually protected. Details: MiniShop3.

Query and mutations

Same querying and mutations rules as resources, within definition fields/filters.