Skip to main content
Go 1.21+, a single module with zero dependencies outside the standard library. Every method returns CMSResponse[T], with T the model that endpoint sends — so GetById hands back CMSResponse[ArticleWrapper] and res.Data.Article.Slug is a typed field read, not a map lookup.
The resources are generated from the OpenAPI spec, so they cover every public operation, including AI conversation and tags.

Install

Initialize

InitCMS returns an error, so always check it. The key is sent as the x-api-key header on every request; there is no header option, by design. For more control, build a Client directly:
Timeout defaults to 30 seconds when left zero.

Make a request

Filters go in as a map[string]any, as the last argument:
Single-resource and search operations return their own model. Every method takes the query map as its last argument, so pass nil when there is nothing to filter on:
A single entity arrives under a key of its own, so it is res.Data.Article, not res.Data. Endpoints that answer with a free-form payload — every delete, the archive — use any for Data.

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.

Error handling

res.Ok reports the API’s own verdict. The Error field carries the status and message the server sent:
ThrowOnError does something different from the other SDKs — it panics, and the panic value is a plain string, not a typed error:
Prefer checking res.Ok. Enabling ThrowOnError costs you the typed error — the status code and payload are discarded in the panic.

Escaping the resource wrapper

cms.Raw is the underlying client, for an endpoint the resources do not cover. Request is untyped; RequestInto decodes into a model you name:
RequestInto is a package function rather than a method because Go does not allow a method to introduce its own type parameters.

Resources

Article, Author, Category, Subcategory, Form, FormSubmission, Language, Tag, Report, AI, AIConversation, Raw.

All operations

Browse the API reference for the full endpoint list.