`/wp/v2/blocks`

Namespace: wp/v2
Route: /wp/v2/blocks

Routes

  • Collection: /wp/v2/blocks
  • Single: /wp/v2/blocks/{id}

HTTP Methods

Collection methods: Unknown

Single methods: GET, POST, PUT, PATCH, DELETE

Request Parameters

Single GET

ParameterTypeRequiredDefaultDescription
idintegerfalseUnique identifier for the post.
contextstringfalseviewScope under which the request is made; determines fields present in response.
excerpt_lengthintegerfalseOverride the default excerpt length.
passwordstringfalseThe password for the post if it is password protected.

Single POST, PUT, PATCH

ParameterTypeRequiredDefaultDescription
idintegerfalseUnique identifier for the post.
datestring, nullfalseThe date the post was published, in the site’s timezone.
date_gmtstring, nullfalseThe date the post was published, as GMT.
slugstringfalseAn alphanumeric identifier for the post unique to its type.
statusstringfalseA named status for the post.
passwordstringfalseA password to protect access to the content and excerpt.
titleobjectfalseThe title for the post.
contentobjectfalseThe content for the post.
excerptobjectfalseThe excerpt for the post.
metaobjectfalseMeta fields.
templatestringfalseThe theme file to use to display the post.
wp_pattern_categoryarrayfalseThe terms assigned to the post in the wp_pattern_category taxonomy.

Single DELETE

ParameterTypeRequiredDefaultDescription
idintegerfalseUnique identifier for the post.
forcebooleanfalseFalseWhether to bypass Trash and force deletion.

Response Schema (Item)

Schema not available.

Authentication

  • Read: public for published reusable blocks; edit_posts for private.
  • Write: edit_posts (create/update), delete_posts (delete).

Example Requests

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

Example Response (trimmed)

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