Skip to content

Update Post Type

PUT
/api/v1/post-types/{key}

Updates a type definition. type_key is immutable. Requires CPT admin role.

Authorizations

SessionAuth

Session ID for authenticated requests

Type
API Key (header: X-Session-ID)

Parameters

Path Parameters

key*

type_key of the post type

Type
string
Required

Request Body

application/json
JSON
{
  
"type_name": "string",
  
"description": "string",
  
"slug_prefix": "string",
  
"field_schema": [
  
  
{
  
  
  
"name": "string",
  
  
  
"label": "string",
  
  
  
"type": "string",
  
  
  
"required": true,
  
  
  
"options": [
  
  
  
  
"string"
  
  
  
],
  
  
  
"max_length": 0,
  
  
  
"placeholder": "string"
  
  
}
  
],
  
"behaviors": {
  
  
"public_by_default": true,
  
  
"enables_seo": true,
  
  
"enables_comments": true,
  
  
"enables_reactions": true,
  
  
"enables_bookmarks": true,
  
  
"enables_views": true,
  
  
"enables_scheduling": true,
  
  
"requires_approval": true,
  
  
"allows_password_visibility": true,
  
  
"default_visibility": "string",
  
  
"allowed_body_formats": [
  
  
  
"string"
  
  
],
  
  
"max_per_author": 0,
  
  
"additionalProperties": "string"
  
},
  
"icon": "string",
  
"color": "string",
  
"is_active": true,
  
"sort_order": 0
}

Responses

Type updated

Playground

Server
Authorization
Variables
Key
Value
Body

Samples

Powered by VitePress OpenAPI

Update a post type definition. type_key cannot change.

Auth: session + post-types admin role.

Parameters

NameInTypeRequiredDescription
keypathstringYestype_key

Request Body

json
{
	"type_name": "Case Study",
	"field_schema": [
		{
			"name": "client",
			"label": "Client",
			"type": "text",
			"required": true
		}
	],
	"behaviors": {
		"requires_approval": true
	},
	"is_active": true
}

Response 200

json
{
	"data": {
		"type_key": "case-study",
		"type_name": "Case Study",
		"updated_at": "2026-08-06T12:00:00.000Z"
	}
}

Response Errors

  • 400 invalid payload
  • 401 missing session
  • 403 insufficient role
  • 404 type not found
  • 503 MODULE_DISABLED

Notes

  • type_key is locked on update.
  • Changing field_schema affects validation of future custom_fields on posts.