What is a Collection?
A Collection is a schema you define using a combination of simple Field Types (like Number Fields, Short Text Fields, and Date Fields). You add items matching this schema to your Collection, and then the entire Collection (or a filtered version of it) can be queried from the API and returned as JSON data. It might help to think of a Collection as a table of structured data, like a spreadsheet:- Each field on the Collection schema is like a table column.
- Each collection item represents a row of the table.
Querying Collections
Collections can be queried in two main ways:- They can be queried directly from the API via any of the Collections endpoints.
- They can be linked to other Content Types (like Single Pages, Page Types, or other Collections) via Reference Fields.
Collections at a glance
| Characteristic | Description |
|---|---|
| Structure | Table-like data using a user-defined schema |
| API access | Query Collections directly from the API, or query referenced content through a linked Page |
| Relationships | Link Collections to Pages or other Collections via Reference fields |
| Limited fieldset | Collections can use most Field Types, except: Components, Component Pickers, and Repeater fields |
Common use cases
Categories and tags
You can use Collections as facets (filterable properties) for your Pages. For example, if you were making a recipe app, your Recipe Page Type might include Reference Fields linking to Collections of key ingredients or main meals.Testimonials
You can use Collections to store reusable promotional content that can be referenced by multiple pages, like testimonials, G2 Badge ratings, CTA content, and more.Related data tables
Use Collections as tables of related data, which you can query directly. For example, a music site might have:- Artists Collection: name, headshot, genre
- Albums Collection: album name, cover art, release date, and artist (which could be a Reference Field back to your Artists Collection!)
Collections best practices:
- Keep fields narrowly focused on the item type.
- Use references instead of duplicating data.
- By default, collection items have an ID number instead of a slug, but you can add a slug field if your frontend needs stable URLs, as the collections GET endpoint allows for dot-notation-based field filtering.
Learn more
Field Types reference
All available field types and options you can use in Pages and Collections
Creating Collections
Learn how to create and link to Collections in the ButterCMS dashboard
API: Read Collections
REST API to fetch collection items
API: Create Collections
REST API for creating, editing, and deleting collection items
Next steps
Blog Engine
Built-in blog solution
Components
Reusable content blocks