Skip to main content
Every AI CMS endpoint — success or failure — returns the same JSON envelope. There is no endpoint that returns a bare array, and none that returns a bare error. You can write your parsing and error handling once and reuse it everywhere.

The envelope

Those four fields are the entire envelope. On list endpoints, data itself carries a pagination object alongside the rows — see Pagination.
statusCode is duplicated inside the body on purpose — some HTTP clients drop the body on an error status, and this makes the code readable even then.

Success


Created


No content

A 204 still returns the envelope, with data as null:

Error

On failure, data carries the detail rather than the resource — often which field failed validation:
Some errors put a human-readable hint there instead:
The exact shape of data on an error is not uniform across endpoints. Branch on statusCode and treat data as best-effort detail for logging — never depend on a specific error field.

Parsing it

You do not need to check res.ok first — reading the body works on error statuses too. Use body.statusCode for control flow.

Pagination

List endpoints return a pagination object inside data, next to the rows: total counts the filtered set, not the page. Changing page or limit changes totalPages but not total.

How the SDKs change this

The SDKs unwrap the envelope for you and return one consistent result object, so you never touch the envelope directly:

SDKs

The full response model per language.

Status codes

Every code and its meaning.