Create a new page via the Write API with support for multiple locales, media uploads, and draft status.
"hero_image": ""). This ensures your content structure remains consistent.
Locale Formats: Define all page content inside of a single fields object for accounts that do not have localization set up. For accounts with localization, all page content for each individual language should be defined inside of an object whose key is the locale slug. Nest these objects inside of the fields object. The locale codes must match those configured in your account.
Media Upload: If Media is the field_type for a chosen field, any URL can be provided as the field’s value. The media corresponding to this URL will be automatically downloaded and uploaded to your ButterCMS media library. This ensures your media is hosted reliably and integrates with ButterCMS’s CDN for optimal performance.
Publication & Scheduling: Pages are created as draft by default. You can set status=published to publish immediately. Scheduling future publication is not supported via the Write API.Write-enabled API token required for creating content.
The API token you use for reading from the ButterCMS API will not allow you to create content in the API. For this you will need to use a different write-enabled token. Chat or email support@buttercms.com to get yours.
Set the Authorization header to Token your_write_api_token.
Example: Authorization: Token abc123def456
Your write-enabled token should never be used anywhere it would be exposed, e.g. in client-side JavaScript.
Set to the API slug of a pre-configured locale (e.g., 'en' or 'fr').
Usage: Only applicable when using the single-locale request format (WITHOUT Locales format).
If you are using the single-locale format to create only a single locale's version of a page, you must specify the locale via this query param, e.g., ?locale=en.
Not applicable when using the multi-locale format (WITH Locales format), as locale codes are specified within the request body under the fields object.
When omitted and using single-locale format, defaults to your organization's default locale.
"en"
Page data in either single-locale or multi-locale format.
Request Body Formats:
fields is an object with each property representing a content field. Note: if creating only a single locale's version, you must specify the locale via query param, e.g., ?locale=en.fields object has an extra level and must be first mapped to the locale code. The locale codes must already be configured in your account; however, you can pick and choose which locales to create.Flexible request schema for creating pages - supports both single-locale and multi-locale formats.
System automatically detects the format based on the structure of the fields object:
Single-Locale Format: fields contains field names as keys (e.g., headline, questions)
Multi-Locale Format: fields contains locale codes as keys (e.g., en, es, fr)
Request Body Formats:
fields as a direct object with field names as keys. Note: if creating only a single locale's version, you must specify the locale via query param, e.g., ?locale=en.fields with locale codes as top-level keys. The locale codes must already be configured in your account.The title of the page.
"Frequently Asked Questions"
The slug of the page.
"faq"
The key of the page type. The page type must already exist in your Butter account.
"questions"
Flexible Fields Object - Two Supported Formats
Format 1: Single-locale/direct fields
fields contains field names as keys (e.g., headline, questions).Format 2: Multi-locale
fields contains locale codes as keys (e.g., en, es, fr).Detection: The system automatically detects the format based on whether the top-level keys are locale codes or field names.
Field requirements
[]).Examples: See the Examples section for sample request bodies.
Status of the page. Can be 'draft' or 'published'. Defaults to 'draft'. Note that you cannot create a page with a status of 'scheduled' via the write API.
draft, published "draft"
Accepted - Page creation started successfully
The request has been accepted for processing. Full page creation occurs asynchronously,
meaning the successfully created page may not show immediately. Pages are validated
prior to returning this response, but it is possible that page creation may fail
after returning a 202 response. If this happens, please contact support.
Indicates that the page creation request has been accepted and is being processed asynchronously
pending "pending"