to navigate
to select
esc to close
GET Collections

Collections API

https://api.airogelcms.com/v1/accounts/:account_id/collections

Collections group content entries (like "posts", "pages", "products"). Each collection has a routing pattern that determines the URL structure for its entries.

Supported Operations

  • GET /v1/accounts/:account_id/collections - List all collections
  • GET /v1/accounts/:account_id/collections/:id - Get a specific collection
  • POST /v1/accounts/:account_id/collections - Create a new collection
  • PUT /v1/accounts/:account_id/collections/:id - Update a collection
  • DELETE /v1/accounts/:account_id/collections/:id - Delete a collection

Routing Patterns

Supported placeholders in the routing field:

PlaceholderSourceExample
:handleEntry handle/slugmy-post
:year4-digit year from published_at2025
:month2-digit month from published_at01
:day2-digit day from published_at08

Create Fields

FieldTypeRequiredDescription
namestringyesDisplay name
handlestringyesURL-friendly identifier
routingstringyesURL pattern with :handle placeholder
root_routingbooleannoWhether entries can be at root level
orderablestringnoSort order: "no", "ascending", "descending"
schema_typestringnoSEO schema type (e.g., "BlogPosting")
template_handlestringnoDefault template for entries
layout_handlestringnoDefault layout for entries
blueprint_handlestringnoAttach an existing blueprint by handle
blueprintobjectnoCreate inline blueprint with fields
index_template_handlestringnoTemplate for index page
index_routingstringnoURL path for index page (e.g., "blog")
index_per_pageintegernoEntries per page (default: 10)

Parameters

Name Type Required Description
account_id string Required Your account ID
handle string Optional Filter by exact handle match
page integer Optional Page number (default: 1)

Request Example

# List collections
curl https://api.airogelcms.com/v1/accounts/$ACCOUNT_ID/collections \
  -H "Authorization: Bearer $API_TOKEN"

# Create collection with existing blueprint
curl -X POST \
  -H "Authorization: Bearer $API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Blog Posts",
    "handle": "posts",
    "routing": "blog/:handle",
    "orderable": "descending",
    "blueprint_handle": "blog-post",
    "index_template_handle": "blog-index",
    "index_routing": "blog",
    "index_per_page": 10
  }' \
  https://api.airogelcms.com/v1/accounts/$ACCOUNT_ID/collections

Response Example

{
  "data": [
    {
      "id": "clctn_abc123",
      "name": "Blog Posts",
      "handle": "posts",
      "routing": "blog/:handle",
      "root_routing": false,
      "orderable": "descending",
      "schema_type": "BlogPosting",
      "template_handle": "post",
      "layout_handle": "default",
      "blueprints": [
        {
          "id": "blprt_xyz789",
          "handle": "blog-post",
          "title": "Blog Post"
        }
      ],
      "created_at": "2025-01-08T12:00:00Z",
      "updated_at": "2025-01-08T12:00:00Z"
    }
  ]
}

Additional Notes

Using existing vs. inline blueprints: Use blueprint_handle to attach an existing blueprint (recommended for imports), or blueprint to create one inline. If both are provided, blueprint_handle takes precedence.

Index pages: Collections can have an index page that displays a paginated list of entries. Set index_template_handle, index_routing, and index_per_page to enable.

Example routing patterns:

  • blog/:handle → /blog/my-post
  • :handle → /about
  • :year/:month/:day/:handle → /2024/06/15/hello-world