Skip to content

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

Playground

Server
Authorization
Body

Samples

Powered by VitePress OpenAPI

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

  • 400 invalid post payload (CUSTOM_FIELDS_*, MAX_PER_AUTHOR, …)
  • 401 missing session
  • 403 missing writer role or APPROVAL_REQUIRED on publish
  • 503 Blog / 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 from POST_TYPES_DEFAULT_TYPE) and custom_fields validated against the type field_schema.
  • post_type is locked after create. Behaviors may enforce approval, scheduling, password visibility, and max_per_author.