Skip to main content
You can import your content from another CMS programmatically via the Write API.
Before importing, configure your Page Types and Collections to match your content structure. (You can create Pages of existing Page Types or items for existing Collections with the Write API, but you will need to set up the schema first in the dashboard.) Note that if you’re setting up a blog, we have a pre-built Blog Engine that may serve your needs.

Write API import

For programmatic imports, use the ButterCMS Write API. This allows you to automate content creation without manual data entry.
Note: Contact ButterCMS support at support@buttercms.com to enable Write API access on your account.

Getting your Write API token

  1. Navigate to Settings in your ButterCMS dashboard
  2. Go to the API Tokens tab
  3. Copy your Write API Token
API Tokens settings page
Keep your Write API Token secure. It allows creating and modifying content in your account.

Creating content via Write API

For full parameter details and code examples, see:

Pages API Reference

Collections API Reference

Blog Engine API Reference

Supported SDKs

Click on any SDK to see examples of how to write Pages, Collection Items, and Blog Posts.

Write API tips

Working with references

To reference Collection items or other Pages, use their slugs or meta IDs:

Working with media

ButterCMS can handle media in several ways: Option 1: External URLs
Option 2: ButterCMS CDN URLs
ButterCMS will automatically download images from external URLs and serve them from the ButterCMS CDN.

Handling localized content

For multilingual content, include locale-specific fields:

Working with Component Pickers

For pages with Component Pickers, pass an array of component objects:
Each object in the array represents a component instance. The key is the component’s API name (lowercase, underscores).

Import from CSV/spreadsheet

For content in spreadsheets, parse and import programmatically:
CSV format example:

Bulk upload

Bulk upload is ideal for:
  • Migrating hundreds or thousands of pages
  • Importing product catalogs from e-commerce systems
  • Loading content from databases or external APIs
  • Populating Collections with reference data
  • Automated content pipelines

Prerequisites

Before bulk uploading:
  1. Write API access enabled - Contact support@buttercms.com
  2. Content types created - Page Types and Collections must exist
  3. Data source prepared - JSON, CSV, database, or API ready
  4. Field mapping documented - Know how source fields map to ButterCMS

Architecture

Complete bulk upload script

Here’s a complete Python script for bulk content migration:

JavaScript/Node.js implementation

Data file format

Structure your data file for bulk upload:

Handling large datasets

Batch processing

For very large datasets, process in batches:

Progress tracking

Checkpoint/resume support

For very long migrations, implement checkpoint support:

Request pacing

These delays help keep bulk migrations stable and reduce the chance of hitting monthly API call limits. Free and Trial plans have a 50,000 API calls per month limit.

Handling 429 responses

Validation before upload

Always validate data before uploading:

Error handling

Handle common errors gracefully:

Common error codes

This list covers common errors. For complete API error documentation, see API Reference.

Best practices

  1. Test with draft status first - Create as drafts, review, then publish
  2. Batch your imports - Import in small batches to identify issues early
  3. Log everything - Keep detailed logs of what was imported
  4. Validate before import - Check data quality before sending to API
  5. Monitor monthly limits - Use pacing and caching to stay within limits
  6. Use idempotent operations - Check if content exists before creating