Collections API

Fetch collections and their items. Collections are custom content types with flexible JSON data.

GET/api/public/collections

Returns all collections with item counts.

Query Parameters

localestring

Count only items in this locale. Defaults to the workspace's default locale.

200Success
json
{
  "collections": [
    {
      "slug": "products",
      "name": "Products",
      "singularName": "Product",
      "pluralName": "Products",
      "icon": "box",
      "itemCount": 10
    }
  ],
  "site": { ... }
}

GET/api/public/collections/{slug}

Returns published items in a collection with pagination.

Query Parameters

localestring

Filter by locale. Defaults to the workspace's default locale.

allLocalesstring

Set to "true" to return items in all locales.

limitnumber

Maximum items to return.

offsetnumber

Pagination offset.

sortBystring

"order" (default), "createdAt", or "updatedAt".

sortOrderstring

"asc" (default) or "desc".

200Success
json
{
  "collection": { "slug": "products", "name": "Products" },
  "items": [
    {
      "slug": "product-1",
      "locale": "fr",
      "data": { "title": "Product 1", "price": 100 },
      "publishedAt": "2025-01-15T12:00:00Z",
      "updatedAt": "2025-01-15T12:00:00Z",
      "metaTitle": "Product 1",
      "metaDescription": "..."
    }
  ],
  "pagination": { "total": 10, "limit": 20, "offset": 0 },
  "site": { ... }
}
404Not Found
json
{ "error": "Collection not found" }

GET/api/public/collections/{slug}/{itemSlug}

Returns a single published collection item with its translations.

Query Parameters

localestring

Locale to fetch. Defaults to the workspace's default locale.

200Success
json
{
  "item": {
    "slug": "product-1",
    "locale": "fr",
    "data": { "title": "Product 1", "price": 100 },
    "publishedAt": "2025-01-15T12:00:00Z",
    "updatedAt": "2025-01-15T12:00:00Z"
  },
  "translations": [{ "locale": "en" }],
  "collection": { "slug": "products", "name": "Products" },
  "site": { ... }
}
404Not Found
json
{ "error": "Collection or item not found" }