Skip to content
View as Markdown

POST Create Pattern From wp_block Payload

POST
/email-patterns/wp-format

Create a pattern from a WordPress wp_block payload, and return it in the same shape.

The counterpart to GET /email-patterns/wp-format, used by the block editor's save path. title and content each accept a plain string or { "raw": "…" }.

Unlike POST /email-patterns, neither field is strictly required: supplying just one is enough, and a missing title is stored as “Untitled Pattern”. Sending neither is rejected.

The response is the created pattern as a bare wp_block object, with no message envelope.

Required capability: fcrm_manage_emails

Enforced by EmailPatternPolicy::verifyRequest(), the policy default for this route group.

Authorizations

ApplicationPasswords

WordPress Application Passwords — use Basic auth with your WordPress username and an application password in the format: username:application_password

Type
API Key (header: Authorization)

Request Body

application/json
JSON
{
"title": "string",
"content": "string",
"meta": {
"wp_pattern_sync_status": "string"
},
"wp_pattern_category": [
0
]
}

Responses

The created pattern in wp_block shape.

application/json
JSON
{
"id": 0,
"date": "string",
"date_gmt": "string",
"modified": "string",
"modified_gmt": "string",
"slug": "string",
"status": "string",
"type": "string",
"link": "string",
"title": {
"raw": "string"
},
"content": {
"raw": "string",
"protected": true
},
"meta": {
},
"wp_pattern_sync_status": "string",
"wp_pattern_category": [
0
]
}

Playground

Authorization
Body

Samples

Powered by VitePress OpenAPI