Create Blog Post
POST
/api/v1/posts
Creates a blog post for writer/admin roles. When CPT is enabled, send post_type and custom_fields. Approval/scheduling/password behaviors may apply.
Authorizations
SessionAuth
Session ID for authenticated requests
Type
API Key (header: X-Session-ID)
Request Body
application/json
JSON "title": "string", "slug": "string", "body": "string", "body_format": "string", "excerpt": "string", "featured_image": "string", "status": "string", "visibility": "string", "password": "string", "category_ids": [ "string" ], "tag_ids": [ "string" ], "comments_enabled": true, "reactions_enabled": true, "scheduled_at": "string", "metadata": { "additionalProperties": "string" }, "post_type": "string", "custom_fields": { "additionalProperties": "string" }
{
}
Responses
Post created
Create a new blog post.
Auth: session + writer role.
Body
- title
- slug
- body
- body_format
- visibility
post_type(CPT)custom_fields(CPT)
Parameters
None.
Request Body
json
{
"title": "Why modular docs matter",
"slug": "why-modular-docs-matter",
"body": "# Why modular docs matter",
"body_format": "markdown",
"visibility": "public",
"post_type": "case-study",
"custom_fields": { "client": "Acme" }
}Response 200
json
{
"data": {
"id": "post_2",
"slug": "why-modular-docs-matter",
"status": "draft",
"post_type": "case-study",
"custom_fields": { "client": "Acme" }
},
"user_context": { "authenticated": true, "user_type": "writer" },
"meta": { "cached": false }
}Response Errors
400invalid post payload (CUSTOM_FIELDS_*,MAX_PER_AUTHOR, …)401missing session403missing writer role orAPPROVAL_REQUIREDon publish503Blog / related module disabled
Notes
- Use this when creating draft content.
- Supports optional comments, reactions, excerpt, and scheduling fields.
- When CPT is enabled, send
post_type(defaults fromPOST_TYPES_DEFAULT_TYPE) andcustom_fieldsvalidated against the typefield_schema. post_typeis locked after create. Behaviors may enforce approval, scheduling, password visibility, andmax_per_author.