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
localestringCount 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": { ... }
}{
"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
localestringFilter by locale. Defaults to the workspace's default locale.
allLocalesstringSet to "true" to return items in all locales.
limitnumberMaximum items to return.
offsetnumberPagination 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": { ... }
}{
"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" }{ "error": "Collection not found" }GET/api/public/collections/{slug}/{itemSlug}
Returns a single published collection item with its translations.
Query Parameters
localestringLocale 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": { ... }
}{
"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" }{ "error": "Collection or item not found" }