Overview
Collections serve as your structured data foundation — tables of organized content designed for reference by Pages or direct API queries. Collections excel at managing reusable data that supports and enhances your primary content. Core characteristics- ID-based retrieval: Numeric ID identification for precise, efficient data access
- Reference-oriented: Designed primarily to be referenced by Pages and other content types
- Flexible schemas: Completely customizable field definitions
- Performance focus: Optimized for faster querying and smaller response sizes
| Feature | Collections | Pages |
|---|---|---|
| Components | No | Yes |
| Repeaters | No | Yes |
| Form integrations | No | Yes |
| Identified by | Numeric ID | Slug |
| Versioning (draft over published) | No | Yes |
Publication states
Collections use draft and published states, with scheduling available via the dashboard.| State | Description | API Access |
|---|---|---|
| Draft | Available via preview mode only | ?preview=1 or ?test=1 |
| Published | Live via standard endpoints with CDN caching | Standard endpoints |
| Scheduled | Dashboard only — not supported via Write API | Preview until publication |
Preview
Preview enables data validation for draft collection items before publication. Enable preview by addingpreview=1 to API requests (or test=1 for the /v2/content/?keys endpoint and legacy clients):
- Create or update collection items in draft status
- Fetch draft items using preview mode
- Validate data structure, content accuracy, and integration behavior
- Review how drafts appear when referenced by Pages
- Publish after validation confirms expected behavior
preview=1 to ensure both the Page draft and referenced Collection drafts are displayed together.
Reference architecture
Collections serve as both reference targets and reference sources within ButterCMS’s content relationship system.Collection-to-page references
Collection items can reference Pages using page slugs:Collection-to-collection references
Collection items can reference other collection items using numeric IDs:Managing references
Adding references: Provide the appropriate identifier (page slug or numeric ID) in Write API requests. The system validates reference targets during processing. Removing references — use the appropriate empty value:| Relationship | Empty value |
|---|---|
| One-to-one | "" (empty string) or null |
| One-to-many | [] (empty array) or null |
- PATCH: Omitted reference fields remain unchanged
- PUT: Full replacement semantics apply — provide all fields including references
Reference levels
Thelevels parameter controls reference field depth in Collection API responses.
| Value | Behavior |
|---|---|
1 | Reference fields return API URIs only (optimal for listings) |
2 (default) | Reference fields return complete objects |
3–5 | Deeper resolution for nested reference chains |
5 (max) | Returns URIs for any remaining references beyond specified depth |
- Use
levels=1for listings or when building dropdown/select options - Use
levels=2(default) for individual item display with reference context - Use
levels=3–5when displaying items with deep reference chains - Use
levels=1for paginated lists to minimize serialization overhead
Localization
Collections can maintain separate content versions for each configured locale. Account configuration: Locale support must be configured in your ButterCMS account settings before creating multi-language collections. API integration:- Single-language: Direct field values (no localization configured)
- Multi-language: Fields nested under locale codes (e.g.,
"en","es","fr")
Best practices
Performance- Start with
levels=1for listing operations and increase only when necessary - Use pagination for large collections to maintain responsive API performance
- Leverage ButterCMS CDN caching for frequently accessed data
- Design schemas that accommodate future data requirements
- Create logical reference patterns that support your content relationships
- Use field validation to maintain data quality across collection items
- Maintain consistent reference relationships across locales where appropriate
- Validate localized data to ensure completeness across all configured locales
Next steps
Read API — Collections
Fetch collection items via the Read API
Write API — Collections
Create and update collection items
Pages — key concepts
Learn how Pages work with Collections
Request/Response format
Understand reference level responses