`/wp/v2/block-types`

Namespace: wp/v2
Route: /wp/v2/block-types

Routes

  • Collection: /wp/v2/block-types
  • Single: /wp/v2/block-types/{namespace}/{name}

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.
namespacestringfalseBlock namespace.

Single GET

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

Response Schema (Item)

FieldTypeDescription
api_versionintegerVersion of block API. (read-only)
titlestringTitle of block type. (read-only)
namestringUnique name identifying the block type. (read-only)
descriptionstringDescription of block type. (read-only)
iconstring, nullIcon of block type. (read-only)
attributesobject, nullBlock attributes. (read-only)
provides_contextobjectContext provided by blocks of this type. (read-only)
uses_contextarrayContext values inherited by blocks of this type. (read-only)
selectorsobjectCustom CSS selectors. (read-only)
supportsobjectBlock supports. (read-only)
categorystring, nullBlock category. (read-only)
is_dynamicbooleanIs the block dynamically rendered. (read-only)
editor_script_handlesarrayEditor script handles. (read-only)
script_handlesarrayPublic facing and editor script handles. (read-only)
view_script_handlesarrayPublic facing script handles. (read-only)
view_script_module_idsarrayPublic facing script module IDs. (read-only)
editor_style_handlesarrayEditor style handles. (read-only)
style_handlesarrayPublic facing and editor style handles. (read-only)
view_style_handlesarrayPublic facing style handles. (read-only)
stylesarrayBlock style variations. (read-only)
variationsarrayBlock variations. (read-only)
textdomainstring, nullPublic text domain. (read-only)
parentarray, nullParent blocks. (read-only)
ancestorarray, nullAncestor blocks. (read-only)
allowed_blocksarray, nullAllowed child block types. (read-only)
keywordsarrayBlock keywords. (read-only)
exampleobject, nullBlock example. (read-only)
block_hooksobjectThis block is automatically inserted near any occurrence of the block types used as keys of this map, into a relative position given by the corresponding value. (read-only)
editor_scriptstring, nullEditor script handle. DEPRECATED: Use editor_script_handles instead. (read-only)
scriptstring, nullPublic facing and editor script handle. DEPRECATED: Use script_handles instead. (read-only)
view_scriptstring, nullPublic facing script handle. DEPRECATED: Use view_script_handles instead. (read-only)
editor_stylestring, nullEditor style handle. DEPRECATED: Use editor_style_handles instead. (read-only)
stylestring, nullPublic facing and editor style handle. DEPRECATED: Use style_handles instead. (read-only)

Authentication

  • Read: public (block registration metadata); no write methods.

Example Requests

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

Example Response (trimmed)

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