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 > General in your dashboard
  2. Copy the correct Read API Token from the API Tokens section
  3. Ensure there are no extra spaces or characters

Write token required (403 Forbidden)

Cause: Attempting to create/update content with a Read API token. The token still authenticates successfully, so this returns 403 Forbidden rather than 401. Solution: Write API access is a paid add-on for Advanced and Professional plans. Purchase it from the Billing page in your dashboard; the Write API Token activates automatically. On a Basic plan, upgrade first or contact support.

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

The exact message depends on the endpoint:
Cause: The specified locale doesn’t exist or is not enabled on your account. 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 exceeds the maximum length of 100 characters. Solution: Ensure search queries:
  • Don’t exceed 100 characters
  • Are URL-encoded if containing special characters

Invalid field filter (404 on Pages, 403 on Collections)

Filtering by a field uses dot notation, e.g. fields.hero.title=value. On Pages, an invalid filter returns a 404:
Omitting the dot returns:
On Collections, an invalid filter key returns a 403 instead:
Cause: The field name after fields. doesn’t exist in your content schema. Solution: Check that:
  • Field names match your content schema exactly
  • You’re using dot notation: fields.hero.title

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
Posts and Collections return the generic {"detail": "Not found."} instead, so you can’t tell those two apart by message text. Check the URL path you called.

Collection not found

Cause: The collection key, or the item ID within it, doesn’t exist. Solution:
  1. Check the collection key in Content Types > Collections
  2. Collection keys may contain letters, numbers, hyphens, and underscores
  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

Method not allowed errors (405)

Unsupported HTTP method

Cause: The HTTP method you used isn’t supported on this endpoint, for example sending DELETE to a Pages or Collections endpoint, neither of which supports deleting via the API. Solution: Check the API reference for the methods an endpoint supports.

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 on the Home dashboard Usage card or the Analytics page
  2. Reduce calls: Cache responses and avoid polling
  3. Wait for reset: The block lifts at the start of the next UTC calendar month
  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

For blog posts, each invalid field is reported under its own key (there’s no fields wrapper):
Pages don’t have a top-level title field, so their validation errors are reported under the page type’s own field keys instead. 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

On Pages, submitting a field key that isn’t defined in the page type’s schema is dropped without an error. On Collections, the same situation returns a 400:
Cause: Trying to set a field that doesn’t exist in the content schema. Solution:
  1. Check the page type or collection schema in Content Types
  2. Ensure field names match exactly
  3. For Collections, remove any fields not defined in the schema

Server errors (500)

Internal Server Error

An unhandled 500 on the API returns an HTML error page, not a JSON body, so don’t try to parse response.json() for a 500. 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