GET
/content/posts/{id}
● Stable
Retrieves a single published post by its unique identifier. Returns the full content object including raw markdown/HTML, metadata, associated media assets, and author information. Requires a valid API token with read:content scope.
🔒 Authentication Required: Bearer Token with
read:content scope
Path Parameters
| Parameter | Type | Description |
|---|---|---|
| id required | string (UUID) | The unique identifier of the post. Must match format xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx |
Query Parameters (Optional)
| Parameter | Type | Description |
|---|---|---|
| format | string | Response format: json (default), html, or markdown |
| fields | string | Comma-separated list of fields to include. Reduces payload size. |
Response Schema
application/json
{
"id": "a1b2c3d4-e5f6-7890-g1h2-i3j4k5l6m7n8",
"title": "Getting Started with FlowCMS",
"slug": "getting-started-flowcms",
"content": "## Welcome\n\nThis is your first post...",
"status": "published",
"author": {
"id": "usr_9x8y7z",
"name": "Alex Morgan",
"avatar_url": "https://cdn.flowcms.io/avatars/alex.jpg"
},
"tags": ["tutorial", "cms", "getting-started"],
"featuredImage": "https://cdn.flowcms.io/media/cover-01.jpg",
"seo": {
"title": "Getting Started with FlowCMS | Docs",
"description": "Learn how to set up and configure..."
},
"createdAt": "2025-04-12T09:30:00.000Z",
"updatedAt": "2025-04-15T14:22:00.000Z"
}
Code Examples
cURL
JavaScript
Node.js
Python
Terminal
curl -X GET "https://api.flowcms.io/v1/content/posts/a1b2c3d4-e5f6-7890-g1h2-i3j4k5l6m7n8" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Accept: application/json"
JavaScript (Browser)
const response = await fetch('https://api.flowcms.io/v1/content/posts/a1b2c3d4-e5f6-7890-g1h2-i3j4k5l6m7n8', {
method: 'GET',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Accept': 'application/json'
}
});
if (!response.ok) throw new Error(`HTTP ${response.status}`);
const post = await response.json();
console.log(post.title);
Node.js
import { flowcms } from '@flowcms/sdk';
const client = flowcms({ apiKey: process.env.FLOWCMS_API_KEY });
try {
const post = await client.content.posts.get('a1b2c3d4-e5f6-7890-g1h2-i3j4k5l6m7n8');
console.log(post.title);
} catch (error) {
console.error('Failed to fetch post:', error.message);
}
Python
from flowcms import FlowCMSClient
client = FlowCMSClient(api_key="YOUR_API_KEY")
try:
post = client.content.posts.get("a1b2c3d4-e5f6-7890-g1h2-i3j4k5l6m7n8")
print(post["title"])
except Exception as e:
print(f"Error: {e}")
Status Codes
| 200 | Success. Returns the requested post object. |
| 400 | Bad Request. Invalid parameter format or malformed query. |
| 401 | Unauthorized. Missing or invalid API key. |
| 404 | Not Found. No post exists with the provided ID. |
| 429 | Rate Limit Exceeded. Too many requests. Retry after X-RateLimit-Reset. |
| 500 | Internal Server Error. FlowCMS encountered an unexpected failure. |