Skip to content

Get Post Type Schema

GET
/api/v1/post-types/{key}/schema

Public schema for editors: field_schema, behaviors, icon, slug_prefix, color. Aggressive cache TTL (~86400s) unless fresh cache mode.

Parameters

Path Parameters

key*

type_key of the post type

Type
string
Required

Responses

Editor schema

application/json
JSON
{
  
"data": {
  
  
"type_key": "string",
  
  
"type_name": "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",
  
  
"slug_prefix": "string",
  
  
"color": "string"
  
}
}

Playground

Server
Variables
Key
Value

Samples

Powered by VitePress OpenAPI

Public editor schema for a type: fields, behaviors, icon, slug prefix, color.

Auth: public.

Parameters

NameInTypeRequiredDescription
keypathstringYestype_key

Request Body

None.

Response 200

json
{
	"data": {
		"type_key": "case-study",
		"type_name": "Case Study",
		"field_schema": [
			{
				"name": "client",
				"label": "Client",
				"type": "text",
				"required": true
			}
		],
		"behaviors": {
			"requires_approval": true,
			"enables_seo": true
		},
		"icon": "briefcase",
		"slug_prefix": "case-studies",
		"color": "#2563eb"
	}
}

Response Errors

  • 404 type not found
  • 503 MODULE_DISABLED

Notes

  • Aggressive cache TTL (~86400s) unless POST_TYPES_FRESH_CACHE_MODE is true.
  • Use this to drive dynamic forms in Admin / editors.