PUT
/content/posts/{id}
Updates an existing post. Provides partial updates (PATCH-like behavior) while remaining strictly idempotent. Only the fields included in the request body will be modified; omitted fields retain their current values.
Path Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| id | string | REQUIRED | The unique identifier of the post to update. Must be a valid UUID v4. |
Headers
| Name | Type | Required | Description |
|---|---|---|---|
| Authorization | string | REQUIRED | Bearer token for authentication. Format: Bearer <your_api_key> |
| Content-Type | string | REQUIRED | Must be application/json |
Request Body
JSON
{
"title": "Updated Article Title",
"slug": "updated-article-title",
"content": "Revised content markdown...",
"status": "published",
"tags": ["tutorial", "cms"],
"published_at": "2025-01-15T10:30:00Z"
}
Body Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| title | string | Post title. Max 255 characters. | |
| slug | string | URL-friendly identifier. Auto-generated if omitted. | |
| content | string | Markdown or HTML content body. | |
| status | enum | draft, published, or archived |
|
| tags | array | List of tag strings. Max 20 tags. | |
| published_at | datetime | ISO 8601 timestamp for scheduling. |
Success Responses
200 OK
The post was successfully updated. Returns the full post object.
200 OK
{
"success": true,
"data": {
"id": "post_a8f3k29d1",
"title": "Updated Article Title",
"slug": "updated-article-title",
"content": "Revised content markdown...",
"status": "published",
"tags": ["tutorial", "cms"],
"author_id": "usr_92f3kd2",
"created_at": "2025-01-10T08:20:00Z",
"updated_at": "2025-01-15T14:22:10Z"
}
}
Error Responses
400 Bad Request
Invalid JSON, missing required fields, or validation failure.
404 Not Found
The specified post ID does not exist or you lack permission.
bash
curl -X PUT https://api.flowcms.io/v1/content/posts/post_a8f3k29d1 \
-H "Authorization: Bearer $FLOWCMS_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"title": "Updated Article Title",
"slug": "updated-article-title",
"content": "Revised content markdown...",
"status": "published",
"tags": ["tutorial", "cms"]
}'
javascript
const response = await fetch(`https://api.flowcms.io/v1/content/posts/${postId}`, {
method: 'PUT',
headers: {
'Authorization': `Bearer ${process.env.FLOWCMS_API_KEY}`,
'Content-Type': 'application/json'
},
body: JSON.stringify({
title: 'Updated Article Title',
slug: 'updated-article-title',
content: 'Revised content markdown...',
status: 'published',
tags: ['tutorial', 'cms']
})
});
const data = await response.json();
console.log(data);
python
import requests
url = f"https://api.flowcms.io/v1/content/posts/{post_id}"
headers = {
"Authorization": f"Bearer {FLOWCMS_API_KEY}",
"Content-Type": "application/json"
}
payload = {
"title": "Updated Article Title",
"slug": "updated-article-title",
"content": "Revised content markdown...",
"status": "published",
"tags": ["tutorial", "cms"]
}
response = requests.put(url, headers=headers, json=payload)
print(response.json())