Skip to main content
Go 1.21+, a single module with zero dependencies outside the standard library. Every method returns (*CMSResponse, error).
This is the most complete SDK: it is generated from the OpenAPI spec, so it covers every public operation, including AI conversation, meta 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

Read operations that take filters take a single map:
Single-resource and search operations use the same shape:
res.Data is interface{} decoded from JSON, typically a map[string]interface{}. Marshal it back through encoding/json to get typed structs, or define your own types and unmarshal into them.

Write operations

Error handling

Two kinds of error, and they are different things:
  • error is a transport problem — DNS, TLS, timeout. Nothing was processed.
  • res.Ok == false is an API response. The request succeeded, the server said no.
ThrowOnError does something different from the other SDKs — it panics, and the panic value is a plain string, not a typed ApiError:
Prefer checking res.Ok. Enabling ThrowOnError costs you the typed error — the status code and payload are discarded in the panic.

Context and cancellation

Escaping the resource wrapper

cms.Raw is the underlying client:

Resources

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

All operations

Browse the API reference for the full endpoint list.