Skip to main content

HTTP status codes overview


Authentication errors (401)

Missing API token

Cause: No API token was included in the request. Solution: Include your API token either as:
  • Query parameter: ?auth_token=YOUR_TOKEN
  • Authorization header: Authorization: Token YOUR_TOKEN

Invalid API token

Cause: The provided API token is incorrect or has been revoked. Solution:
  1. Go to Settings > API Tokens in your dashboard
  2. Copy the correct Read API Token
  3. Ensure there are no extra spaces or characters

Write token required

Cause: Attempting to create/update content with a Read API token. Solution: Write operations require a Write API Token. Contact support@buttercms.com to request write access.

Bad request errors (400)

Invalid query parameters

Cause: Query parameter value is out of valid range or wrong type. Solution: Check the API documentation for valid parameter values:
  • levels: Integer 1-5
  • page: Positive integer
  • page_size: Integer 1-100

Invalid locale parameter

Cause: The specified locale doesn’t exist or is not enabled. Solution:
  1. Go to Settings > Localization in your dashboard
  2. Verify the locale slug matches your API request
  3. Locale slugs are typically lowercase (e.g., en, es, fr-ca)

Invalid search parameters

Cause: Search query is malformed or contains invalid characters. Solution: Ensure search queries:
  • Are URL-encoded if containing special characters
  • Don’t exceed maximum length (typically 256 characters)
  • Use valid search syntax

Invalid field filter

Cause: Requested fields don’t exist or have invalid syntax. Solution: Check that:
  • Field names match your content schema exactly
  • Use dot notation for nested fields: fields.hero.title
  • Fields parameter is comma-separated without spaces

Forbidden errors (403)

Multiple pages found

Cause: When using page_type=*, multiple pages share the same slug. Solution:
  1. Specify a page type instead of *: /pages/landing_page/homepage
  2. Or ensure slugs are unique across all page types

Access Denied

Cause: Your account or API token doesn’t have access to this resource. Solution:
  • Verify you’re using the correct account’s API token
  • Check if your plan includes access to this feature
  • Contact support if you believe this is an error

Not found errors (404)

Page not found

Cause: No page exists with the specified page type and slug. Solution:
  1. Verify the page is published (not draft)
  2. Check the slug matches exactly (case-sensitive)
  3. Confirm the page type key is correct
  4. Verify the page exists in the dashboard

Collection not found

Cause: The collection key doesn’t exist. Solution:
  1. Check the collection key in Content Types > Collections
  2. Collection keys use underscores, not hyphens
  3. Keys are case-sensitive

Blog Post not found

Cause: No blog post exists with the specified slug. Solution:
  1. Verify the post is published
  2. Check the slug is correct
  3. Ensure you’re not including /blog/ prefix in the slug

Rate limit errors (429)

Too Many Requests

Cause: A Free or Trial account exceeded its monthly API call limit and has been temporarily blocked. Solution:
  1. Check usage: Review API calls in your billing dashboard
  2. Reduce calls: Cache responses and avoid polling
  3. Wait for reset: The block lifts at the next billing cycle
  4. Upgrade if needed: Paid plans are not blocked for monthly API overages
Rate Limit Response Headers:
When you exceed your plan’s monthly API call limit, the Retry-After value indicates the seconds remaining until the end of the current billing month when your limit resets.
Retry Logic Example:

Validation Errors

Content validation failed

Cause: Content being created/updated fails validation rules. Solution: Check each field mentioned in the error:
  • Ensure required fields are provided
  • Verify slugs are unique
  • Check field values meet validation rules (min/max length, format)

Schema Mismatch

Cause: Trying to set a field that doesn’t exist in the content schema. Solution:
  1. Check the page type schema in Content Types
  2. Ensure field names match exactly
  3. Update your code to match the current schema

Server errors (500)

Internal Server Error

Cause: An unexpected error on ButterCMS servers. Solution:
  1. Wait a few minutes and retry
  2. Check the API Status Page
  3. If persistent, contact support with:
    • The exact endpoint you’re calling
    • Request parameters
    • Timestamp of the error

Error handling best practices

JavaScript/TypeScript

Python


Quick reference table


Common Errors

Step-by-step solutions for common issues

Debugging Guide

How to debug your integration

API Reference

Full API documentation

Contact Support

Get help from our team