Skip to main content
PHP 8.1+, distributed as a Composer package. Uses cURL directly, so there is no PSR-18 client to configure and no HTTP client dependency.

Install

Initialize

The key is sent as the x-api-key header on every request. There is no header option, by design.

Make a request

Every method returns an Envelope with success, statusCode, message and data. Filters go in as the second argument:
data is the endpoint’s generated model, so fields are properties rather than array keys. A single entity arrives under a key of its own:
A field typed as a map of language codes is a MultilingualString, readable by array access or as a property:
The runtime return type is the shared Envelope; the payload model is named in the @phpstan-return annotation on each method, so static analysis still knows what data holds.

Write operations

Only mainTitle, content and category are required to create; author defaults to the authenticated user. update takes the whole document in its body, so id is a field of that body rather than a separate argument. The delete method is named deleteId because delete is a reserved word in PHP.

Error handling

Errors are return values, not exceptions, unless you opt in. A failed call still comes back as an Envelope with success false:
To throw an ApiError instead, which carries the unparsed body:
throwOnError throws on any non-2xx response. Leaving it off and checking $res->success is the safer default for batch work.

Timeouts

timeoutMs defaults to 0, which means no timeout — a request will hang until the server or PHP’s max_execution_time stops it. Set it explicitly in production.

Escaping the resource wrapper

$cms->raw is the underlying client, for calling endpoints the resources do not cover. Its request method takes the method, the path, and an options array; it sends only x-api-key, so there is no header to set by hand:
Method names follow the route segments as generated, including the ones that read as verbs and methods together — idReactionPOST, commentsGetAll. The API reference lists every operation under its route.

Resources

article, author, category, subcategory, form, formSubmission, language, tag, report, ai, aiConversation, raw.

All operations

Browse the API reference for the full endpoint list.