Create new pages using ButterCMS Write API. Programmatically create content to enable powerful use cases and scale your content faster.
Note: For Pages, PUT behaves like PATCH (partial update). Use either method to perform partial updates.
This OpenAPI specification covers the complete ButterCMS API, including read and write operations for Pages, Blog Posts, Collections, and more.
This is a new version of our API documentation built with OpenAPI standards. If you encounter any issues, inaccuracies, or have suggestions for improvement, please report them to support@buttercms.com.
The previous version of our documentation is still available at: https://buttercms.com/docs/previous-api/
The ButterCMS API is organized around REST principles with predictable, resource-oriented URLs and uses HTTP response codes to indicate API errors. JSON is returned by all API responses, including errors.
Our API provides comprehensive content management capabilities through both read and write operations. Content is served through a global CDN with 150+ edge locations, ensuring fast delivery worldwide.
The API supports creating, updating, and deleting items of three main content types:
Pages: Fully customizable, reusable schemas that are supercharged with features like structured local and global components, form integrations, and repeaters. These can be individually fetched via a slug and are ideal for complex web content requiring flexible layouts and advanced functionality.
Collections: Lighter-weight, customizable, reusable schemas for tables of data that are fetched via ID. Perfect for structured content like categories, team members, or product catalogs that primarily serve as reference data.
Blog Posts: Built-in content type from our blog engine, which comes out-of-the-box with categorization, tagging, predefined SEO, and authors. Designed for chronological content with standardized blog functionality.
Authentication is handled through token-based access; read operations can use a query parameter (auth_token
) while write operations require header-based authentication for enhanced security.
https://api.buttercms.com/v2/
Complete guide to ButterCMS component system, exclusively available for Pages to create dynamic, structured layouts with reusable content blocks.
Important: Components are only available for Pages and are not supported by Collections or Blog Posts. This page-exclusive functionality enables sophisticated content architecture and flexible layouts that distinguish Pages from other content types.
Complete Webhooks - Events system for real-time content change notifications.
ButterCMS sends HTTP POST notifications to your configured endpoints whenever content changes occur. This enables real-time synchronization, cache invalidation, automated workflows, and multi-channel content publishing.
Retrieve pages from your ButterCMS account.
Single Pages: Use *
as the page_type to get Single Pages (those without a Page Type) which represent unique pages on your site like your Homepage. Useful for creating your sitemap.xml.
Page Type Pages: Use the actual page type slug to get pages of that specific type. Page Types allow you to create many pages with the same structure.
Note: The fields of a page are defined by you, they are customizable. Sample responses below contain a basic set of fields for illustrative purposes.
Retrieve a paginated list of all published blog posts, automatically sorted by publication date with the newest posts appearing first. This endpoint is ideal for building blog listing pages, RSS feeds, or content archives.
Performance Optimization: Use the exclude_body=true
parameter when building post listing pages to significantly reduce response size by excluding the full post content. This improves loading performance while still providing titles, summaries, metadata, and author information needed for listing displays.
Page number for page-based pagination.
Mutually exclusive with limit/offset parameters.
Number of items per page for page-based pagination.
Mutually exclusive with limit/offset parameters.
Maximum number of items to return for offset-based pagination.
Mutually exclusive with page/page_size parameters.
Number of items to skip before starting to return results.
Mutually exclusive with page/page_size parameters.
Set to 1 to return the latest draft version of a page. Useful for previewing changes before publishing live. i.e. &preview=1
. If you are trying to view a scheduled page for which the most recent page version is published, you must pass the preview parameter to see the scheduled changes.
Set to 1
to access unpublished/draft collection items. Useful for staging environments.
When true
, excludes the full post body from the response.
Performance benefit: Significantly reduces response size when displaying lists of blog posts.
https://api.buttercms.com/v2/posts/
curl -i -X GET \
'https://api.buttercms.com/v2/posts/?page=2&page_size=5&limit=5&offset=10&preview=1&exclude_body=true&author_slug=api-test&category_slug=test-category&tag_slug=test-tag&auth_token=your_api_token%2CYOUR_API_KEY_HERE'
Success - Blog Posts Retrieved
Returns a list of blog posts matching the specified criteria. Posts are sorted by publish date with the most recent posts first.
Blog posts response using page-based pagination (default)
Array of blog post objects sorted by publish date (newest first)
Full URL to the blog post
Timestamp when the blog post was created
Timestamp when the blog post was last updated
Timestamp when the blog post was published
URL to the featured image, null if no featured image
HTML content body of the blog post (excluded if exclude_body=true)
Plain text summary of the blog post
Meta description for SEO and social sharing
Publication status of the blog post
Using ?page=2&page_size=5 parameters
{ "meta": { "count": 25, "next_page": 3, "previous_page": 1 }, "data": [ { … } ] }
Retrieve a specific blog post by its unique slug, including complete post content, metadata, and navigation information. This endpoint is ideal for building individual blog post pages with full content display.
Universal Access: This endpoint retrieves posts regardless of their publication status (published, draft, or scheduled), making it perfect for preview functionality and content management workflows. Note that draft and scheduled posts won't appear in listing endpoints unless preview mode is specifically enabled.
Navigation Support: The response includes a helpful meta
object containing next_post
and previous_post
navigation links, allowing you to easily implement "Previous/Next" navigation on your blog post pages without additional API calls.
Important: You must append a trailing slash to the URL path:
/v2/posts/your-post-slug/
. This is required for the endpoint to function correctly.
https://api.buttercms.com/v2/posts/{slug}/
curl -i -X GET \
'https://api.buttercms.com/v2/posts/hello-world/?auth_token=your_api_token%2CYOUR_API_KEY_HERE'
{ "meta": { "next_post": null, "previous_post": { … } }, "data": { "url": "http://www.example.com/blog/hello-world", "created": "2015-06-12T13:59:32.441289Z", "published": "2015-06-12T00:00:00Z", "author": { … }, "categories": [ … ], "tags": [ … ], "featured_image": null, "featured_image_alt": "", "slug": "hello-world", "title": "This is a blog post", "body": "<p class=\"\">This is a blog post to test the API.</p>", "summary": "This is a blog post to test the API.", "seo_title": "This is a blog post", "meta_description": "This is a blog post to test the API.", "status": "published" } }
Webhook event notifications sent by ButterCMS when content changes occur in your account.
ButterCMS automatically sends webhook notifications for various content events including blog posts, pages, and collection items. These events enable real-time integration with your applications, triggering immediate responses to content changes.
Event Types: Webhooks are triggered for create, update, publish, unpublish, and delete operations across all content types. Each event includes comprehensive payload data about the content that changed.
Delivery Method: All webhook events are delivered as HTTP POST requests to your configured endpoint URLs, with JSON payloads containing event metadata and complete content data.
Configuration: Webhook events are configured per content type in your ButterCMS account settings. You can select which events to receive and configure different endpoint URLs for different event types.
Generate XML feeds for content syndication and SEO.
All feeds can be filtered by category or tag and include only published content from your organization.
ButterCMS has an integration with Filestack for image transformations. You can leverage their robust set of image transformation capabilities.
After you upload an image, to create a thumbnail, here's an example:
https://cdn.buttercms.com/3ccPHhYHTNK2zQ14gCOy
https://cdn.buttercms.com/resize=width:100,height:100/3ccPHhYHTNK2zQ14gCOy
For complete transformation options and parameters, see the full Filestack documentation.