Skip to content

API Documentation ​

Welcome to the CMS API documentation. This API provides endpoints for managing documents, components, content, and more.

Base URL ​

All API requests should be made to:

https://admin.flatnode.net/api/v1

Authentication ​

All API requests require authentication using a Bearer token.

Getting a Token ​

Tokens are associated with Projects. To authenticate:

  1. Obtain a personal access token for your project
  2. Include it in the Authorization header of all requests

Using the Token ​

Include your token in the request headers:

http
Authorization: Bearer your-token-here

Token Abilities ​

Tokens carry one or more abilities, checked against each endpoint's required verb: create, read, update, delete. A bare verb (e.g. read) grants that action across every resource type.

To scope a token to a single resource instead, grant {resource}.{verb} (e.g. document.read, file.update) rather than the bare verb. An endpoint accepts either form - a token needs the resource-scoped ability or the bare verb, not both - so existing tokens with only the bare verbs keep working unchanged.

Resources that can be scoped this way: document, content, component, library, file, file-variant-definition (all four verbs), plus search and validation (read only).

content additionally has approve and publish, used by its version workflow: content.approve gates submit's review step (approve/reject), and content.publish gates schedule/promote/withdraw. Neither is implied by content.update - a token that can edit content can't approve or publish it unless granted separately.

Example: a token with only ['file.read', 'file.create'] can upload and read files but gets a 403 on every document/content/component endpoint.

Example request with authentication:

bash
curl -X GET "https://admin.flatnode.net/api/v1/document/550e8400-e29b-41d4-a716-446655440000" \
  -H "Authorization: Bearer your-token-here" \
  -H "Content-Type: application/json"

Response Format ​

All API responses are returned in JSON format. Successful responses typically include:

  • 200 OK - Successful GET, PATCH, PUT, DELETE requests
  • 201 Created - Successful POST requests
  • 422 Unprocessable Entity - Validation errors
  • 404 Not Found - Resource not found
  • 401 Unauthorized - Authentication required

Date/Time Format ​

Datetimes in responses are RFC 3339 in UTC, written with a numeric offset rather than Z:

json
"2026-11-10T18:42:08+00:00"

One exception: a component version's savedAt is a plain YYYY-MM-DD HH:MM:SS in UTC, with no offset at all. Parse it as UTC.

Datetimes you send (reveal_at, conceal_at) are not this strict - Z and a numeric offset are both accepted.

Error Response Format ​

When an error occurs, the response will include a message and optionally an errors object:

json
{
  "message": "The given data was invalid.",
  "errors": {
    "field_name": [
      "The field name is required."
    ]
  }
}

Rate Limiting ​

Two limits apply, both counted per project owner across all of that owner's projects and tokens: a per-minute burst, and a monthly request quota. Every successful response carries X-Quota-Limit, X-Quota-Remaining and X-Quota-Reset, so a client can see where it stands without a separate call, and exceeding either limit is a 429 with Retry-After.

Back off on 429. See Rate and plan limits for the numbers, what counts against the quota, and the separate caps on how much can be created.

Identifiers ​

Every identifier in this API is a UUID. Documents, components, content nodes, files and libraries are all addressed by their uuid, both in the URL and in request bodies (DocumentId, ComponentId, HostContentId, ...). Passing a numeric id gets you a 422 naming the field, or a 404 on a path parameter.

Endpoints that echo a resource identify it by _uuid and name their other fields in lowerCamelCase, the same convention rendered content uses. See Identifiers are UUIDs if you have a client built against an older shape.

In rendered content, the prefixed keys mean:

KeyIs the uuid of
_uuidthis content node - what /content/{uuid} takes
_componentthe component schema this node is an instance of

Quick Start Example ​

A complete example of building a page the way an editor will keep working on it: a page root with a slot, one block dropped into the slot, both published, and the composed result read back. Why a slot rather than a single field is the subject of Modelling pages for editors.

bash
# 1. Create a document
curl -X POST "https://admin.flatnode.net/api/v1/document" \
  -H "Authorization: Bearer your-token-here" \
  -H "Content-Type: application/json" \
  -d '{"title": "My Page"}'

# Response: {"message": "document created", "document": {"_uuid": "1f1daf90-f21e-6356-a0fe-1291eb64d3f7", ...}}
# Keep the _uuid.

# 2. Find the page component. A new project is born with one, called
#    `Page` with the handle `page`: a title and one open `body` slot.
curl -X GET "https://admin.flatnode.net/api/v1/component" \
  -H "Authorization: Bearer your-token-here"
# The list answers {"message": "components", "data": [{"_uuid": "<uuid>", "title": "Page",
#   "handle": "page", "version": 1, ..., "schema": {...}}, ...]} - take the `_uuid` of the
#   one whose `handle` is "page".
#
# Or make your own - any component with a slot does:
#   {"title": "Page", "type": "object", "properties": {
#      "title": {"type": "string"},
#      "body":  {"$ref": "http://access.flatnode.net/slot/body#"}}}

# 3. Create the page root from it
curl -X POST "https://admin.flatnode.net/api/v1/content" \
  -H "Authorization: Bearer your-token-here" \
  -H "Content-Type: application/json" \
  -d '{
    "DocumentId": "1f1daf90-f21e-6356-a0fe-1291eb64d3f7",
    "ComponentId": "<Page component uuid>",
    "position": "first",
    "data": {"title": "Hello, World!"}
  }'

# Response: {"message":"OK","data":{"_uuid":"1f1daf91-5f91-641a-a0f1-1291eb64d3f7", ...}}
# Keep data._uuid: it is the HostContentId in step 5.

# 4. Create a block component to drop into the slot
curl -X POST "https://admin.flatnode.net/api/v1/component" \
  -H "Authorization: Bearer your-token-here" \
  -H "Content-Type: application/json" \
  -d '{
    "title": "TextBlock",
    "type": "object",
    "properties": {
      "heading": {"type": "string"},
      "body":    {"type": "string", "format": "richtext"}
    }
  }'

# Response: {"message": "Component created.", "data": {"_uuid": "1f1daf91-5d0f-6b10-9c1f-1291eb64d3f7", ...}}

# 5. Drop a block into the page's body slot. `parent` names the page
#    root's _uuid (the content instance, not its _component) and the slot.
curl -X POST "https://admin.flatnode.net/api/v1/content" \
  -H "Authorization: Bearer your-token-here" \
  -H "Content-Type: application/json" \
  -d '{
    "DocumentId": "1f1daf90-f21e-6356-a0fe-1291eb64d3f7",
    "ComponentId": "1f1daf91-5d0f-6b10-9c1f-1291eb64d3f7",
    "parent": {"HostContentId": "1f1daf91-5f91-641a-a0f1-1291eb64d3f7", "Slot": "body"},
    "position": "last",
    "data": {"heading": "First block", "body": {"type": "doc", "content": [
      {"type": "paragraph", "content": [{"type": "text", "text": "An editor can add more of these, and reorder them."}]}
    ]}}
  }'

# Response: {"message":"OK","data":{"_uuid":"1f1daf92-0a11-6c2e-9f14-1291eb64d3f7", ...}}

# 6. Publish both. Every node starts as a draft and has its own lifecycle -
#    an unpromoted block renders as nothing for a public reader, and an
#    unpromoted root means the document fetch returns only {"_document": {...}}.
curl -X POST "https://admin.flatnode.net/api/v1/content/1f1daf91-5f91-641a-a0f1-1291eb64d3f7/promote" \
  -H "Authorization: Bearer your-token-here"
curl -X POST "https://admin.flatnode.net/api/v1/content/1f1daf92-0a11-6c2e-9f14-1291eb64d3f7/promote" \
  -H "Authorization: Bearer your-token-here"

# 7. Read the composed page. The slot arrives as an array under its own
#    name, one envelope per block, in the editor's order.
curl -X GET "https://admin.flatnode.net/api/v1/document/1f1daf90-f21e-6356-a0fe-1291eb64d3f7" \
  -H "Authorization: Bearer your-token-here"

# Response (simplified - every block also carries _type and _component):
# {
#   "_uuid": "1f1daf91-5f91-641a-a0f1-1291eb64d3f7",
#   "_entry": "…",
#   "_value": {
#     "title": "Hello, World!",
#     "body": [
#       { "_uuid": "1f1daf92-0a11-6c2e-9f14-1291eb64d3f7", "_entry": "…",
#         "_value": { "heading": "First block", "body": { "type": "doc", "content": [ … ] } } }
#     ]
#   },
#   "_document": { "title": "My Page", "slug": "my-page" }
# }

Step 6 needs the content.publish ability - see Token Abilities above. Give the block component a handle and it arrives with _handle too, which is what a renderer should switch on. The block's body is a Rich text field, so it takes and returns a document, not a string; add ?richtext=html to the read in step 5 to get it as HTML instead.

Guides ​

  • Modelling pages for editors - Which primitive to reach for and why: slots, references and image fields, with the Nordlys Observatory demo as the worked example

Endpoints Overview ​

  • Documents - Create and manage documents
  • Components - Define component schemas
  • Content - Create and manage content instances, including versions and translations
  • Slots & References - Build complex nested structures with slots and schema references
  • Files - Upload and manage files
  • Libraries - Filterable collections of entries sharing one component schema
  • Search - Search and query content
  • Validation - Validate data against schemas
  • Webhooks - Get told when content changes, instead of polling for it