Skip to navigation

Create reusable block OAuth Scope: posts:write

Currently in beta

This feature is currently in beta and the API is subject to change.

Available on the Pro and Enterprise plans

This endpoint is available to workspaces on the Pro and Enterprise plans.

Create a reusable block that belongs to the workspace. The block is published at once, so every publication in the workspace can add it to its posts and templates.

Body and footer blocks take their content as blocks or body_content; without either they start with an empty paragraph. Header blocks take a header_image_url and otherwise start with the default header style. Blocks that need a publication (advertisement, advertisement_logo, automated_advertisement_placement, embed_link, paywall_break, poll, programmatic_ads_logo and rss) and condition sets in visibility_settings are refused, and so is reusable_block: a reusable block can’t contain another one.

Requires an API key with access to every publication in the workspace.

Authentication

AuthorizationBearer

Bearer authentication of the form Bearer <token>, where token is your auth token.

Request

This endpoint expects an object.
kindenumRequired
Whether the block is a header, a footer, or content placed inside a post.
Allowed values:
namestringRequired
The name of the reusable block. Must be unique within the workspace.
descriptionstringOptional
The description of the reusable block.
blockslist of objectsOptional

The structured content of a body or footer block. Cannot be combined with a non-empty body_content. Blocks that need a publication are refused; see the endpoint description. Not accepted on header blocks.

body_contentstringOptional

The content of a body or footer block, as a single raw HTML string. The HTML is wrapped in an htmlSnippet block internally. Note that <style> and <link> tags are removed during sanitization, so use inline styles for all visual styling. Cannot be combined with non-empty blocks. Not accepted on header blocks.

header_image_urlstringOptional
The URL of an image to download and use as a header block's image. Only accepted on header blocks.

Response

Created
dataobject

Errors

400
Bad Request Error
401
Unauthorized Error
403
Forbidden Error
404
Not Found Error
422
Unprocessable Entity Error
429
Too Many Requests Error
500
Internal Server Error