`/wp/v2/types`

Namespace: wp/v2
Route: /wp/v2/types

Routes

  • Collection: /wp/v2/types
  • Single: /wp/v2/types/{type}

HTTP Methods

Collection methods: GET

Single methods: GET

Request Parameters

Collection GET

ParameterTypeRequiredDefaultDescription
contextstringfalseviewScope under which the request is made; determines fields present in response.

Single GET

ParameterTypeRequiredDefaultDescription
typestringfalseAn alphanumeric identifier for the post type.
contextstringfalseviewScope under which the request is made; determines fields present in response.

Response Schema (Item)

FieldTypeDescription
capabilitiesobjectAll capabilities used by the post type. (read-only)
descriptionstringA human-readable description of the post type. (read-only)
hierarchicalbooleanWhether or not the post type should have children. (read-only)
viewablebooleanWhether or not the post type can be viewed. (read-only)
labelsobjectHuman-readable labels for the post type for various contexts. (read-only)
namestringThe title for the post type. (read-only)
slugstringAn alphanumeric identifier for the post type. (read-only)
supportsobjectAll features, supported by the post type. (read-only)
has_archivestring, booleanIf the value is a string, the value will be used as the archive slug. If the value is false the post type has no archive. (read-only)
taxonomiesarrayTaxonomies associated with post type. (read-only)
rest_basestringREST base route for the post type. (read-only)
rest_namespacestringREST route’s namespace for the post type. (read-only)
visibilityobjectThe visibility settings for the post type. (read-only)
iconstring, nullThe icon for the post type. (read-only)
templatearrayThe block template associated with the post type. (read-only)
template_lockstring, booleanThe template_lock associated with the post type, or false if none. (read-only)

Authentication

  • Read: public; no write methods.

Example Requests

bash
curl -X GET "https://wordpress.org/news/wp-json/wp/v2/types"
bash
curl -X GET "https://wordpress.org/news/wp-json/wp/v2/types/post"

Example Response (trimmed)

json
{
  "id": 1,
  "_links": {
    "self": [{ "href": "/wp/v2/types/1" }]
  }
}