Skip to content

Get Post Type Stats​

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

Admin stats for one type: by_status, by_lang, by_author.

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

Responses​

Stats payload

application/json
JSON
{
  
"data": {
  
  
"type_key": "string",
  
  
"total": 0,
  
  
"by_status": {
  
  
  
"additionalProperties": 0
  
  
},
  
  
"by_lang": {
  
  
  
"additionalProperties": 0
  
  
},
  
  
"by_author": [
  
  
  
{
  
  
  
  
"additionalProperties": "string"
  
  
  
}
  
  
]
  
}
}

Playground​

Server
Authorization
Variables
Key
Value

Samples​

Powered by VitePress OpenAPI

Admin stats for one type: totals by status, language, and author.

Auth: session + post-types admin role.

Parameters ​

NameInTypeRequiredDescription
keypathstringYestype_key

Request Body ​

None.

Response 200 ​

json
{
	"data": {
		"type_key": "case-study",
		"total": 12,
		"by_status": { "published": 8, "draft": 4 },
		"by_lang": { "en": 7, "es": 5 },
		"by_author": [{ "author_id": "u_1", "count": 5 }]
	}
}

Response Errors ​

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

Notes ​

  • Useful for type management dashboards and capacity checks (max_per_author).