curl --request PATCH \
--url https://api.buttercms.com/v2/posts/{slug}/ \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"slug": "the-new-post-slug",
"body": "<h1>Updated</h1><p>This blog post was updated via API</p>"
}
'{
"status": "pending",
"info: locale variant": "Created new 'es' locale variant; copied content from 'en' variant. Tags and categories are copied from the source variant unless explicitly provided in the request body."
}Update Blog Post via Write API
Partially update an existing blog post via the Write API with support for flexible field modification and status changes.
curl --request PATCH \
--url https://api.buttercms.com/v2/posts/{slug}/ \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"slug": "the-new-post-slug",
"body": "<h1>Updated</h1><p>This blog post was updated via API</p>"
}
'{
"status": "pending",
"info: locale variant": "Created new 'es' locale variant; copied content from 'en' variant. Tags and categories are copied from the source variant unless explicitly provided in the request body."
}locale query parameter to target a specific locale variant (e.g. ?locale=es). When omitted, updates the post in its current locale. If the locale variant does not yet exist, a new locale variant is created and linked to the original post — this is the primary way to create translations of existing blog posts.
Scheduling Limitations: Blog post scheduling is not available through the Write API. Any scheduled parameters in your request will be silently ignored (not treated as errors), allowing you to safely update posts that are currently scheduled without affecting their publication timing.
Media Integration: Include upload_images_to_media_library=true in your request to automatically download and upload any image URLs within the post body to your ButterCMS media library. This ensures reliable hosting and CDN performance for your content images.
Asynchronous Processing: This endpoint returns 202 Accepted immediately to ensure fast response times for your application. The actual update processing, including media uploads, content validation, and webhook notifications, happens in the background processing queue.Authorizations
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. Write API access is a paid add-on for Advanced and Professional plans, enabled from the Billing page of your account. It isn't offered on Basic plans.
Set the Authorization header to Token your_write_api_token. The ?auth_token= query parameter also works for write requests, but a header is safer because URLs are more likely to be logged.
Example: Authorization: Token abc123def456
Your write-enabled token should never be used anywhere it would be exposed, e.g. in client-side JavaScript.
Path Parameters
The slug of the blog post to update.
100Query Parameters
Target a specific locale variant (e.g. en, es). When omitted, updates the post in its current locale. If the locale variant does not exist, a new one is created and linked to the original post.
10Body
Request schema for updating an existing blog post. All fields are optional for partial updates.
Note: If scheduled timestamp or status: "scheduled" are provided, they will be ignored and warning messages will be included in the response.
The title of the blog post
200"Updated Blog Post Title"
The slug of the blog post.
Auto-Slugification: The API automatically converts your input to a valid slug format using unicode slugification.
100"updated-blog-post-slug"
The status of the post.
Note: "scheduled" status will be ignored and a warning message will be included in the response.
draft, published, scheduled "published"
Array of category names. Categories will be created if they don't exist.
["Updated Category", "New Category"]
Array of tag names. Tags will be created if they don't exist.
["updated", "refresh", "api"]
Can be a remote URL to an image.
The image will always be uploaded to the media library (the value of upload_images_to_media_library is ignored for featured images).
"https://example.com/updated-featured-image.jpg"
Alt text for the featured image
250"Updated featured image alt text."
Should be a string of escaped HTML.
In case it contains any remote URLs to images, the upload_images_to_media_library flag controls the behavior.
"<h1>Updated Content</h1><p>This blog post was updated via API</p>"
Plain-text summary of the blog post
2000"Updated summary of the blog post."
SEO title for HTML title tag
100"Updated SEO Title"
Meta description for SEO and social sharing
"Updated meta description for better SEO."
Defaults to false.
If set to true, any image URLs in the body property will be uploaded to the Butter Media Library and the original URL will be replaced with the media library URL.
Note: Featured images are always uploaded regardless of this setting.
true
Note: This field will be ignored - scheduled timestamps cannot be created or altered via write API.
If provided, this field will be removed from the request and a warning message will be included in the response.
"2024-12-25T10:00:00Z"
Response
Created - New Locale Variant
Returned instead of 202 when ?locale= names a configured locale that doesn't yet exist for this post. A new locale variant is created, copying content from the source variant (tags and categories are copied too, unless explicitly provided in the request body).
Success response for blog post updates (202 Accepted). May include warning messages for ignored fields.
Indicates that the blog post update is being processed asynchronously
pending "pending"
Warning message when scheduled field is ignored
"Scheduled timestamps cannot be created or altered via write API. This field will be ignored."
Warning message when scheduled status is ignored
"A blog post's status cannot be set asscheduledvia write API at this time. This field will be ignored."
Additional warning messages for other ignored fields
Was this page helpful?