Basker Docs

Response format

Standard envelope for list and single-record responses

This reference documents the response format for all Partners API endpoints, including list responses, single-document responses, create/update/delete responses, and the fields removed by response sanitisation.

List response

All GET requests to collection endpoints (without an ID) return a paginated list response.

HTTP status: 200

Shape

{
  "docs": [
    { "id": "...", "title": "...", "..." : "..." },
    { "id": "...", "title": "...", "..." : "..." }
  ],
  "totalDocs": 47,
  "limit": 10,
  "totalPages": 5,
  "page": 1,
  "pagingCounter": 1,
  "hasPrevPage": false,
  "hasNextPage": true,
  "prevPage": null,
  "nextPage": 2
}

Fields

FieldTypeDescription
docsarrayArray of document objects
totalDocsnumberTotal number of documents matching the query
limitnumberMaximum documents per page
totalPagesnumberTotal number of pages
pagenumberCurrent page number (1-indexed)
pagingCounternumberIndex of the first document on this page (1-indexed)
hasPrevPagebooleantrue if a previous page exists
hasNextPagebooleantrue if a next page exists
prevPagenumber or nullPrevious page number, or null on the first page
nextPagenumber or nullNext page number, or null on the last page

When pagination=false is set, pagination metadata fields may be absent and all matching documents are returned in docs.

Single-document response

GET requests with an ID return the document as a flat JSON object (not wrapped in a docs array).

HTTP status: 200

Shape

{
  "id": "6639a1c2f3b4a5d6e7f90001",
  "title": "La Traviata",
  "slug": "la-traviata-autumn-2025",
  "startDate": "2025-10-15T18:30:00.000Z",
  "createdAt": "2025-06-01T10:00:00.000Z",
  "updatedAt": "2025-06-15T08:00:00.000Z"
}

Create response

POST requests return the newly created document.

HTTP status: 201

Shape

The created document as a flat JSON object, identical in shape to a single-document response.

{
  "id": "6639a1c2f3b4a5d6e7f90099",
  "title": "Swan Lake",
  "slug": "swan-lake-winter-2025",
  "createdAt": "2025-07-15T10:00:00.000Z",
  "updatedAt": "2025-07-15T10:00:00.000Z"
}

Update response

PATCH and PUT requests return the full updated document.

HTTP status: 200

Shape

The updated document as a flat JSON object, with all fields reflecting their current values after the update.

Delete response

DELETE requests return the deleted document.

HTTP status: 200

Shape

The deleted document as a flat JSON object.

Response sanitisation

Before returning any document, the API applies a sanitisation process that removes internal and integration-specific fields. These fields are stripped recursively from the document and all nested objects.

Fields removed

FieldReason
tenantInternal multi-tenancy field; for group-shared reads it may identify another member of your tenant group
slugLockInternal CMS lock state
themeTemplateInternal theme configuration
spektrixSpektrix integration data (internal)
eleventElevent integration data (internal)
renderModeInternal rendering configuration

These fields are removed from the top-level document and from all nested objects, including populated relationships, blocks, and array items.

Data transformations

Before returning documents, the API normalizes CMS-shaped data into consumer-friendly output:

  • Rich text fields include rendered HTML via _html companion fields.
  • Relationship wrappers are unwrapped to plain objects/arrays.
  • Block field data is flattened into direct block properties.
  • Custom attributes are exposed under attributes.custom.

This is always applied. Treat API responses as the canonical shape for integrations.

Common response fields

Most documents include these standard fields:

FieldTypeDescription
idstringUnique document identifier (always present)
createdAtstring (ISO 8601)Timestamp when the document was first created
updatedAtstring (ISO 8601)Timestamp of the last modification

Error response

All error responses follow a consistent format.

Shape

{
  "error": "Unauthorized",
  "message": "Valid API key required",
  "requestId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
}
FieldTypeDescription
errorstringShort error category
messagestringHuman-readable description
requestIdstringUnique identifier for the request (useful for support)

The requestId field is included in most error responses. Some early-stage errors (such as version validation) may omit it.

See Error reference for all error codes.

Content-Type

All responses use Content-Type: application/json. Response bodies are pretty-printed with 2-space indentation.

On this page