> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://developers.beehiiv.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://developers.beehiiv.com/_mcp/server.

# Update reusable block <Badge intent="info" minimal outlined>OAuth Scope: posts:write</Badge>

PATCH https://api.beehiiv.com/v2/workspaces/reusable_blocks/{reusableBlockId}
Content-Type: application/json

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

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

Update a reusable block. Only the fields you send change. Sending `blocks`, `body_content` or `header_image_url` publishes the block, so every post, template and automation email using it picks up the change. Unpublished changes made to the block in the app are discarded, so only what you send goes live. Changing only the `name`, `description` or `status` does not publish the block. Set `status` to `archived` to archive the block, or `active` to restore it. An archived block stops appearing in templates, automation emails and unsent posts, and cannot be added to new ones. Restoring a block lets it be added again; it does not return to the places it was removed from. 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.

Reference: https://developers.beehiiv.com/api-reference/reusable-blocks/update

## Authentication

- `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer <token>`, where token is your auth token.

## Request

### Path parameters

- `reusableBlockId` (string, required) — The prefixed ID of the reusable block object

### Body (application/json)

This endpoint expects an object.

- `name` (string, optional) — The name of the reusable block. Must be unique within the workspace.
- `description` (string, optional) — The description of the reusable block.
- `blocks` (list of Block, optional) — The structured content of a body or footer block. Replaces the block's content, and an empty list clears it. 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_content` (string, optional) — 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. Replaces the block's content, and an empty string clears it. Cannot be combined with non-empty `blocks`. Not accepted on header blocks.
- `header_image_url` (string, optional) — The URL of an image to download and use as a header block's image. Only accepted on header blocks. An empty string removes the image, including one drawn from a publication field.
- `status` (enum, optional) — Set to `archived` to archive the block, or `active` to restore it.
  - Allowed values: `active`, `archived`

## Response

### 200

OK

- `data` (ReusableBlockDetail, required)

## Errors

### 400 Bad Request Error

Bad Request

- `status` (integer, required)
- `statusText` (string, required)
- `errors` (list of ErrorDetail, required)

### 401 Unauthorized Error

Unauthorized. The API key or OAuth access token is missing, invalid, or expired.

- `status` (integer, required)
- `statusText` (string, required)
- `errors` (list of ErrorDetail, required)

### 403 Forbidden Error

Forbidden

- `status` (integer, required)
- `statusText` (string, required)
- `errors` (list of ErrorDetail, required)

### 404 Not Found Error

Resource Not Found

- `status` (integer, required)
- `statusText` (string, required)
- `errors` (list of ErrorDetail, required)

### 422 Unprocessable Entity Error

Unprocessable Entity

- `status` (integer, required)
- `statusText` (string, required)
- `errors` (list of ErrorDetail, required)

### 429 Too Many Requests Error

Rate Limit Exceeded

- `status` (integer, required)
- `statusText` (string, required)
- `errors` (list of ErrorDetail, required)

### 500 Internal Server Error

Internal Server Error

- `status` (integer, required)
- `statusText` (string, required)
- `errors` (list of ErrorDetail, required)

## Types

### Block

A block in the post content.

- `type`: `paragraph`
  - `formattedText` (list of ParagraphBlockTextSection, optional) — The formatted content of the paragraph.
  - `plaintext` (string, optional) — The plaintext content of the paragraph.
  - `textAlign` (enum, optional) — Legacy paragraph alignment field. Use `textAlignment` for new integrations.
    - Allowed values: `left`, `center`, `right`
  - `textAlignment` (enum, optional) — The text alignment of the paragraph (e.g., left, center, right).
    - Allowed values: `left`, `center`, `right`
  - `visibility_settings` (VisibilitySettings, optional) — Optional rules for when/where this block is shown, including dynamic content targeting via condition sets.
  - `visual_settings` (VisualSettings, optional) — Optional styling for borders, spacing, colors, etc.
- `type`: `image`
  - `imageUrl` (string, required) — The URL of the image.
  - `alt_text` (string, optional) — Alternative text for the image.
  - `caption` (string, optional) — A caption for the image.
  - `captionAlignment` (enum, optional) — The text alignment of the caption.
    - Allowed values: `left`, `center`, `right`
  - `imageAlignment` (enum, optional) — The text alignment of the image.
    - Allowed values: `left`, `center`, `right`
  - `title` (string, optional) — The title of the image.
  - `url` (string, optional) — The URL that the image should link to.
  - `visibility_settings` (VisibilitySettings, optional) — Optional rules for when/where this block is shown, including dynamic content targeting via condition sets.
  - `visual_settings` (VisualSettings, optional) — Optional styling for borders, spacing, colors, etc.
  - `width` (integer, optional) — The width of the image. Should be between 1 and 100.
- `type`: `button`
  - `href` (string, required) — The URL the button should use.
  - `text` (string, required) — The text content of the button.
  - `alignment` (enum, optional) — The text alignment of the button.
    - Allowed values: `left`, `center`, `right`
  - `size` (enum, optional) — The size of the button (e.g., small, normal, large).
    - Allowed values: `small`, `normal`, `large`
  - `target` (string, optional) — The target of the button (e.g., _blank).
  - `visibility_settings` (VisibilitySettings, optional) — Optional rules for when/where this block is shown, including dynamic content targeting via condition sets.
  - `visual_settings` (VisualSettings, optional) — Optional styling for borders, spacing, colors, etc.
- `type`: `heading`
  - `level` (enum, required) — The level of the header (e.g., 1, 2, 3, etc.).
    - Allowed values: `1`, `2`, `3`, `4`, `5`, `6`
  - `anchorHeader` (boolean, optional, default: true) — Whether the header should be an anchor header.
  - `anchorIncludeInToc` (boolean, optional, default: true) — Whether the header should be included in the table of contents.
  - `formattedText` (list of ParagraphBlockTextSection, optional) — The formatted content of the header, supporting links and inline styling.
  - `text` (string, optional) — The text content of the header. Ignored if `formattedText` is provided.
  - `textAlignment` (enum, optional) — The text alignment of the header (e.g., left, center, right).
    - Allowed values: `left`, `center`, `right`
  - `visibility_settings` (VisibilitySettings, optional) — Optional rules for when/where this block is shown, including dynamic content targeting via condition sets.
  - `visual_settings` (VisualSettings, optional) — Optional styling for borders, spacing, colors, etc.
- `type`: `rss`
  - `articleLayout` (enum, optional) — The layout of the articles from the feed.
    - Allowed values: `1-col`, `2-col`, `3-col`, `4-col`
  - `articlesToShow` (integer, optional) — The number of articles to show from the feed.
  - `ctaAlignment` (enum, optional) — The alignment of the call to action.
    - Allowed values: `Left`, `Center`, `Right`
  - `ctaStyle` (enum, optional) — The style of the call to action.
    - Allowed values: `CTA button`, `CTA link`, `Title as link`, `Thumbnail as link`, `Title and thumbnail as link`
  - `ctaText` (string, optional) — The text of the call to action. Applicable if ctaStyle is button or link.
  - `externalRssFeedId` (string, optional) — The ID of the external RSS feed.
  - `refreshOnSend` (boolean, optional) — Whether or not to refresh the contents from the RSS feed before sending out the email.
  - `rssFeedUrl` (string, optional) — The URL of the RSS feed.
  - `selectionMode` (enum, optional) — How to select feed articles, by count or time window.
    - Allowed values: `count`, `time`
  - `showArticleThumbnail` (boolean, optional) — Whether to show the article thumbnail.
  - `showArticleTitle` (boolean, optional) — Whether to show the article title.
  - `showAuthor` (boolean, optional) — Whether to show the author.
  - `showCategories` (boolean, optional) — Whether to show the categories.
  - `showContent` (boolean, optional) — Whether to show the article content.
  - `showCta` (boolean, optional) — Whether to show a call to action.
  - `showDescription` (boolean, optional) — Whether to show the article description.
  - `showPublishedDate` (boolean, optional) — Whether to show the date the article was published
  - `thumbnailPosition` (enum, optional) — The position of the thumbnail.
    - Allowed values: `Above Title`, `Below Title`, `Left of content`, `Right of content`, `Alternating Horizontally`
  - `timeWindowHours` (integer, optional) — Trailing window in hours when selectionMode is time.
  - `visibility_settings` (VisibilitySettings, optional) — Optional rules for when/where this block is shown, including dynamic content targeting via condition sets.
  - `visual_settings` (VisualSettings, optional) — Optional styling for borders, spacing, colors, etc.
- `type`: `advertisement`
  - `opportunity_id` (string, required) — The ID of the Advertisement opportunity.
  - `visibility_settings` (VisibilitySettings, optional) — Optional rules for when/where this block is shown, including dynamic content targeting via condition sets.
  - `visual_settings` (VisualSettings, optional) — Optional styling for borders, spacing, colors, etc.
- `type`: `advertisement_logo`
  - `opportunity_id` (string, required) — The ID of the advertisement opportunity whose logo to display.
  - `override_sponsor_text` (enum, required) — The sponsor text to display with the advertisement logo. Required.
    - Allowed values: `sponsored_by`, `together_with`, `in_partnership_with`, `presented_by`, `todays_sponsor`
  - `override_align` (enum, optional) — The logo alignment. Defaults to center.
    - Allowed values: `left`, `center`, `right`
  - `override_width` (integer, optional) — The logo width as a percentage. Must be greater than 0. Defaults to 100.
  - `visibility_settings` (VisibilitySettings, optional) — Optional rules for when/where this block is shown, including dynamic content targeting via condition sets.
  - `visual_settings` (VisualSettings, optional) — Optional styling for borders, spacing, colors, etc.
- `type`: `automated_advertisement_placement`
  - `advertisement_kind` (enum, required) — The automated advertisement kind to fill at publish time.
    - Allowed values: `primary`, `secondary`, `tertiary`
  - `visibility_settings` (VisibilitySettings, optional) — Optional rules for when/where this block is shown, including dynamic content targeting via condition sets.
  - `visual_settings` (VisualSettings, optional) — Optional styling for borders, spacing, colors, etc.
- `type`: `programmatic_ads_logo`
  - `override_sponsor_text` (enum, required) — The sponsor text to display with the advertisement logo. Required.
    - Allowed values: `sponsored_by`, `together_with`, `in_partnership_with`, `presented_by`, `todays_sponsor`
  - `override_align` (enum, optional) — The logo alignment. Defaults to center.
    - Allowed values: `left`, `center`, `right`
  - `override_width` (integer, optional) — The logo width as a percentage. Must be greater than 0. Defaults to 100.
  - `visibility_settings` (VisibilitySettings, optional) — Optional rules for when/where this block is shown, including dynamic content targeting via condition sets.
  - `visual_settings` (VisualSettings, optional) — Optional styling for borders, spacing, colors, etc.
- `type`: `columns`
  - `columns` (list of ColumnBlock, required) — The blocks that make up the columns.
  - `stackOnMobile` (boolean, optional, default: true) — Whether columns should stack vertically on mobile devices.
  - `visibility_settings` (VisibilitySettings, optional) — Optional rules for when/where this block is shown, including dynamic content targeting via condition sets.
  - `visual_settings` (VisualSettings, optional) — Optional styling for borders, spacing, colors, etc.
- `type`: `list`
  - `items` (list of ListBlockItem, required) — The items in the list.
  - `listType` (enum, optional) — The type of list (e.g., ordered, unordered).
    - Allowed values: `ordered`, `unordered`
  - `startNumber` (integer, optional) — The number to start the list at. Only applicable if listType is ordered.
  - `visibility_settings` (VisibilitySettings, optional) — Optional rules for when/where this block is shown, including dynamic content targeting via condition sets.
  - `visual_settings` (VisualSettings, optional) — Optional styling for borders, spacing, colors, etc.
- `type`: `table`
  - `rows` (list of list of TableCellData, required) — The rows of the table.
  - `headerColumn` (boolean, optional, default: false) — Whether the first column is a header column.
  - `headerRow` (boolean, optional, default: true) — Whether the first row is a header row.
  - `visibility_settings` (VisibilitySettings, optional) — Optional rules for when/where this block is shown, including dynamic content targeting via condition sets.
  - `visual_settings` (VisualSettings, optional) — Optional styling for borders, spacing, colors, etc.
- `type`: `html`
  - `html` (string, required) — The raw HTML content. Note that `<style>` and `<link>` tags are removed during sanitization — use inline styles for all visual styling.
  - `visibility_settings` (VisibilitySettings, optional) — Optional rules for when/where this block is shown, including dynamic content targeting via condition sets.
  - `visual_settings` (VisualSettings, optional) — Optional styling for borders, spacing, colors, etc.
- `type`: `embed_link`
  - `url` (string, required) — The URL of the embed link.
  - `visibility_settings` (VisibilitySettings, optional) — Optional rules for when/where this block is shown, including dynamic content targeting via condition sets.
  - `visual_settings` (VisualSettings, optional) — Optional styling for borders, spacing, colors, etc.
- `type`: `poll`
  - `poll_id` (string, required) — The ID of the poll you wish to include.
  - `show_options_initially` (boolean, optional) — Whether to show the poll options initially. Defaults to false.
  - `visibility_settings` (VisibilitySettings, optional) — Optional rules for when/where this block is shown, including dynamic content targeting via condition sets.
  - `visual_settings` (VisualSettings, optional) — Optional styling for borders, spacing, colors, etc.
- `type`: `quote`
  - `quote` (string, required) — The text of the quote.
  - `alignment` (enum, optional) — The text alignment of the quote. Defaults depend on the variant.
    - Allowed values: `left`, `center`, `right`
  - `author` (string, optional) — The author of the quote.
  - `variant` (enum, optional) — The type of quote block. Defaults to "block".
    - Allowed values: `block`, `inline`, `quotation`
  - `visibility_settings` (VisibilitySettings, optional) — Optional rules for when/where this block is shown, including dynamic content targeting via condition sets.
  - `visual_settings` (VisualSettings, optional) — Optional styling for borders, spacing, colors, etc.
- `type`: `reusable_block`
  - `reusable_block_id` (string, required) — The ID of a published body block from the workspace's reusable blocks. The post shows the block's latest content until the post is published, when that content is copied into the post. Reusable blocks can be placed at the top level of `blocks` only: not in `body_content`, not inside `section` or `columns`, and without `visual_settings` or `visibility_settings`.
- `type`: `content_break`
- `type`: `paywall_break`
  - `paywall_id` (string, required) — The ID of the paywall.
- `type`: `section`
  - `blocks` (list of SectionableBlock, required) — The blocks to group inside this section. Must contain at least one block. Cannot contain `section`, `columns` or `reusable_block` blocks.
  - `visibility_settings` (VisibilitySettings, optional) — Optional rules for when/where this section is shown, including dynamic content targeting via condition sets.
  - `visual_settings` (VisualSettings, optional) — Optional styling applied to the section as a whole (background color, padding, borders, etc.).

### ReusableBlockDetail

- `created` (integer, required) — When the block was created. Measured in seconds since the Unix epoch.
- `id` (string, required) — The prefixed ID of the reusable block.
- `kind` (enum, required) — Whether the block is a header, a footer, or content placed inside a post.
  - Allowed values: `header`, `footer`, `body`
- `name` (string, required) — The name of the reusable block.
- `status` (enum, required) — Whether the block is active or has been archived. An archived block stops appearing in templates, automation emails and unsent posts, and cannot be added to new ones.
  - Allowed values: `active`, `archived`
- `updated` (integer, required) — When the block was last saved. Measured in seconds since the Unix epoch. Archiving or restoring a block does not change it.
- `description` (string, optional) — The description of the reusable block.
- `header_image_url` (string, optional) — The URL of a header block's image, or `null` when it has none. Omitted for footer and body blocks.

### ErrorDetail

- `message` (string, required)
- `code` (string, required)

### ParagraphBlockTextSection

- `text` (string, required) — The text content of the paragraph.
- `styling` (list of enum, optional) — The inline styles for the text.
  - Allowed values: `bold`, `italic`, `underline`, `strikethrough`
- `text_color` (string, optional) — The CSS color value for the text.
- `highlight_color` (string, optional) — The CSS color value for the text highlight.
- `link` (Link, optional) — The link of the text.

### VisibilitySettings

- `show_on_web` (boolean, optional) — Whether to show the block on the web.
- `show_on_email` (boolean, optional) — Whether to show the block on the email.
- `show_to_anonymous_users_web` (boolean, optional) — Whether to show the block to anonymous users on the web.
- `show_to_free_subscribers` (boolean, optional) — Whether to show the block to free subscribers.
- `show_to_paid_subscribers` (boolean, optional) — Whether to show the block to paid subscribers.
- `show_to_subscribers_with_referral_value` (integer, optional) — The exact referral count required to show the block to subscribers.
- `show_to_subscribers_with_referral_condition` (enum, optional) — The condition required to show the block to subscribers.
  - Allowed values: `eq`, `gt`, `lt`
- `condition_set_ids` (list of string, optional) — An optional list of condition set UUIDs to gate this block behind dynamic content targeting. When provided, only subscribers matching the specified condition sets will see this block. Condition sets must belong to the same publication and be active.
- `condition_set_operator` (enum, optional) — Instructs how to combine multiple condition sets. Defaults to "or" (subscriber can match any condition). Use "and" to show the block if the subscriber meets all conditions.
  - Allowed values: `and`, `or`

### VisualSettings

- `background_color` (string, optional) — The background color of the block.
- `text_color` (string, optional) — The text color of the block.
- `border_color` (string, optional) — The border color of the block.
- `border_style` (enum, optional) — The border style of the block.
  - Allowed values: `solid`, `dashed`, `dotted`
- `border_width` (integer, optional) — The border width of the block.
- `border_width_top` (integer, optional) — The border width of the top of the block.
- `border_width_bottom` (integer, optional) — The border width of the bottom of the block.
- `border_width_left` (integer, optional) — The border width of the left of the block.
- `border_width_right` (integer, optional) — The border width of the right of the block.
- `border_radius` (integer, optional) — The border radius of the block.
- `border_radius_top_left` (integer, optional) — The border radius of the top left of the block.
- `border_radius_top_right` (integer, optional) — The border radius of the top right of the block.
- `border_radius_bottom_left` (integer, optional) — The border radius of the bottom left of the block.
- `border_radius_bottom_right` (integer, optional) — The border radius of the bottom right of the block.
- `inner_spacing` (integer, optional) — The inner spacing of the block.
- `inner_spacing_top` (integer, optional) — The inner spacing of the top of the block.
- `inner_spacing_bottom` (integer, optional) — The inner spacing of the bottom of the block.
- `inner_spacing_left` (integer, optional) — The inner spacing of the left of the block.
- `inner_spacing_right` (integer, optional) — The inner spacing of the right of the block.
- `outer_spacing` (integer, optional) — The outer spacing of the block.
- `outer_spacing_top` (integer, optional) — The outer spacing of the top of the block.
- `outer_spacing_bottom` (integer, optional) — The outer spacing of the bottom of the block.
- `outer_spacing_left` (integer, optional) — The outer spacing of the left of the block.
- `outer_spacing_right` (integer, optional) — The outer spacing of the right of the block.

### ColumnBlock

- `blocks` (list of EmbeddableBlocks, required) — The blocks that make up the column.
- `position` (enum, optional) — The column position. This field is deprecated but supported for existing column layouts.
  - Allowed values: `left`, `right`
- `width` (integer, optional) — The column width percentage. When omitted, width is calculated automatically.
- `verticalAlign` (enum, optional) — The vertical alignment of the column content.
  - Allowed values: `top`, `middle`, `bottom`

### ListBlockItem

A list item as either plain text or formatted text data.

- string
- List Block Item Data: ListBlockItemData

### TableCellData

- `text` (string, optional) — The text content of the cell.
- `formattedText` (list of ParagraphBlockTextSection, optional) — The formatted content of the cell.
- `alignment` (enum, optional) — The text alignment of the cell.
  - Allowed values: `left`, `center`, `right`
- `colspan` (integer, optional, default: 1) — The number of columns the cell spans.
- `rowspan` (integer, optional, default: 1) — The number of rows the cell spans.

### SectionableBlock

A block that can appear inside a section. Excludes `section` and `columns` (TipTap's schema does not allow nested sections), and `reusable_block`, whose content can hold a section.

- `type`: `paragraph`
  - `formattedText` (list of ParagraphBlockTextSection, optional) — The formatted content of the paragraph.
  - `plaintext` (string, optional) — The plaintext content of the paragraph.
  - `textAlign` (enum, optional) — Legacy paragraph alignment field. Use `textAlignment` for new integrations.
    - Allowed values: `left`, `center`, `right`
  - `textAlignment` (enum, optional) — The text alignment of the paragraph (e.g., left, center, right).
    - Allowed values: `left`, `center`, `right`
  - `visibility_settings` (VisibilitySettings, optional) — Optional rules for when/where this block is shown, including dynamic content targeting via condition sets.
  - `visual_settings` (VisualSettings, optional) — Optional styling for borders, spacing, colors, etc.
- `type`: `image`
  - `imageUrl` (string, required) — The URL of the image.
  - `alt_text` (string, optional) — Alternative text for the image.
  - `caption` (string, optional) — A caption for the image.
  - `captionAlignment` (enum, optional) — The text alignment of the caption.
    - Allowed values: `left`, `center`, `right`
  - `imageAlignment` (enum, optional) — The text alignment of the image.
    - Allowed values: `left`, `center`, `right`
  - `title` (string, optional) — The title of the image.
  - `url` (string, optional) — The URL that the image should link to.
  - `visibility_settings` (VisibilitySettings, optional) — Optional rules for when/where this block is shown, including dynamic content targeting via condition sets.
  - `visual_settings` (VisualSettings, optional) — Optional styling for borders, spacing, colors, etc.
  - `width` (integer, optional) — The width of the image. Should be between 1 and 100.
- `type`: `button`
  - `href` (string, required) — The URL the button should use.
  - `text` (string, required) — The text content of the button.
  - `alignment` (enum, optional) — The text alignment of the button.
    - Allowed values: `left`, `center`, `right`
  - `size` (enum, optional) — The size of the button (e.g., small, normal, large).
    - Allowed values: `small`, `normal`, `large`
  - `target` (string, optional) — The target of the button (e.g., _blank).
  - `visibility_settings` (VisibilitySettings, optional) — Optional rules for when/where this block is shown, including dynamic content targeting via condition sets.
  - `visual_settings` (VisualSettings, optional) — Optional styling for borders, spacing, colors, etc.
- `type`: `heading`
  - `level` (enum, required) — The level of the header (e.g., 1, 2, 3, etc.).
    - Allowed values: `1`, `2`, `3`, `4`, `5`, `6`
  - `anchorHeader` (boolean, optional, default: true) — Whether the header should be an anchor header.
  - `anchorIncludeInToc` (boolean, optional, default: true) — Whether the header should be included in the table of contents.
  - `formattedText` (list of ParagraphBlockTextSection, optional) — The formatted content of the header, supporting links and inline styling.
  - `text` (string, optional) — The text content of the header. Ignored if `formattedText` is provided.
  - `textAlignment` (enum, optional) — The text alignment of the header (e.g., left, center, right).
    - Allowed values: `left`, `center`, `right`
  - `visibility_settings` (VisibilitySettings, optional) — Optional rules for when/where this block is shown, including dynamic content targeting via condition sets.
  - `visual_settings` (VisualSettings, optional) — Optional styling for borders, spacing, colors, etc.
- `type`: `rss`
  - `articleLayout` (enum, optional) — The layout of the articles from the feed.
    - Allowed values: `1-col`, `2-col`, `3-col`, `4-col`
  - `articlesToShow` (integer, optional) — The number of articles to show from the feed.
  - `ctaAlignment` (enum, optional) — The alignment of the call to action.
    - Allowed values: `Left`, `Center`, `Right`
  - `ctaStyle` (enum, optional) — The style of the call to action.
    - Allowed values: `CTA button`, `CTA link`, `Title as link`, `Thumbnail as link`, `Title and thumbnail as link`
  - `ctaText` (string, optional) — The text of the call to action. Applicable if ctaStyle is button or link.
  - `externalRssFeedId` (string, optional) — The ID of the external RSS feed.
  - `refreshOnSend` (boolean, optional) — Whether or not to refresh the contents from the RSS feed before sending out the email.
  - `rssFeedUrl` (string, optional) — The URL of the RSS feed.
  - `selectionMode` (enum, optional) — How to select feed articles, by count or time window.
    - Allowed values: `count`, `time`
  - `showArticleThumbnail` (boolean, optional) — Whether to show the article thumbnail.
  - `showArticleTitle` (boolean, optional) — Whether to show the article title.
  - `showAuthor` (boolean, optional) — Whether to show the author.
  - `showCategories` (boolean, optional) — Whether to show the categories.
  - `showContent` (boolean, optional) — Whether to show the article content.
  - `showCta` (boolean, optional) — Whether to show a call to action.
  - `showDescription` (boolean, optional) — Whether to show the article description.
  - `showPublishedDate` (boolean, optional) — Whether to show the date the article was published
  - `thumbnailPosition` (enum, optional) — The position of the thumbnail.
    - Allowed values: `Above Title`, `Below Title`, `Left of content`, `Right of content`, `Alternating Horizontally`
  - `timeWindowHours` (integer, optional) — Trailing window in hours when selectionMode is time.
  - `visibility_settings` (VisibilitySettings, optional) — Optional rules for when/where this block is shown, including dynamic content targeting via condition sets.
  - `visual_settings` (VisualSettings, optional) — Optional styling for borders, spacing, colors, etc.
- `type`: `advertisement`
  - `opportunity_id` (string, required) — The ID of the Advertisement opportunity.
  - `visibility_settings` (VisibilitySettings, optional) — Optional rules for when/where this block is shown, including dynamic content targeting via condition sets.
  - `visual_settings` (VisualSettings, optional) — Optional styling for borders, spacing, colors, etc.
- `type`: `advertisement_logo`
  - `opportunity_id` (string, required) — The ID of the advertisement opportunity whose logo to display.
  - `override_sponsor_text` (enum, required) — The sponsor text to display with the advertisement logo. Required.
    - Allowed values: `sponsored_by`, `together_with`, `in_partnership_with`, `presented_by`, `todays_sponsor`
  - `override_align` (enum, optional) — The logo alignment. Defaults to center.
    - Allowed values: `left`, `center`, `right`
  - `override_width` (integer, optional) — The logo width as a percentage. Must be greater than 0. Defaults to 100.
  - `visibility_settings` (VisibilitySettings, optional) — Optional rules for when/where this block is shown, including dynamic content targeting via condition sets.
  - `visual_settings` (VisualSettings, optional) — Optional styling for borders, spacing, colors, etc.
- `type`: `list`
  - `items` (list of ListBlockItem, required) — The items in the list.
  - `listType` (enum, optional) — The type of list (e.g., ordered, unordered).
    - Allowed values: `ordered`, `unordered`
  - `startNumber` (integer, optional) — The number to start the list at. Only applicable if listType is ordered.
  - `visibility_settings` (VisibilitySettings, optional) — Optional rules for when/where this block is shown, including dynamic content targeting via condition sets.
  - `visual_settings` (VisualSettings, optional) — Optional styling for borders, spacing, colors, etc.
- `type`: `table`
  - `rows` (list of list of TableCellData, required) — The rows of the table.
  - `headerColumn` (boolean, optional, default: false) — Whether the first column is a header column.
  - `headerRow` (boolean, optional, default: true) — Whether the first row is a header row.
  - `visibility_settings` (VisibilitySettings, optional) — Optional rules for when/where this block is shown, including dynamic content targeting via condition sets.
  - `visual_settings` (VisualSettings, optional) — Optional styling for borders, spacing, colors, etc.
- `type`: `html`
  - `html` (string, required) — The raw HTML content. Note that `<style>` and `<link>` tags are removed during sanitization — use inline styles for all visual styling.
  - `visibility_settings` (VisibilitySettings, optional) — Optional rules for when/where this block is shown, including dynamic content targeting via condition sets.
  - `visual_settings` (VisualSettings, optional) — Optional styling for borders, spacing, colors, etc.
- `type`: `embed_link`
  - `url` (string, required) — The URL of the embed link.
  - `visibility_settings` (VisibilitySettings, optional) — Optional rules for when/where this block is shown, including dynamic content targeting via condition sets.
  - `visual_settings` (VisualSettings, optional) — Optional styling for borders, spacing, colors, etc.
- `type`: `poll`
  - `poll_id` (string, required) — The ID of the poll you wish to include.
  - `show_options_initially` (boolean, optional) — Whether to show the poll options initially. Defaults to false.
  - `visibility_settings` (VisibilitySettings, optional) — Optional rules for when/where this block is shown, including dynamic content targeting via condition sets.
  - `visual_settings` (VisualSettings, optional) — Optional styling for borders, spacing, colors, etc.
- `type`: `quote`
  - `quote` (string, required) — The text of the quote.
  - `alignment` (enum, optional) — The text alignment of the quote. Defaults depend on the variant.
    - Allowed values: `left`, `center`, `right`
  - `author` (string, optional) — The author of the quote.
  - `variant` (enum, optional) — The type of quote block. Defaults to "block".
    - Allowed values: `block`, `inline`, `quotation`
  - `visibility_settings` (VisibilitySettings, optional) — Optional rules for when/where this block is shown, including dynamic content targeting via condition sets.
  - `visual_settings` (VisualSettings, optional) — Optional styling for borders, spacing, colors, etc.
- `type`: `content_break`
- `type`: `paywall_break`
  - `paywall_id` (string, required) — The ID of the paywall.

### Link

- `href` (string, required) — The URL of the link.
- `target` (string, optional) — The target of the link (e.g., _blank).

### EmbeddableBlocks

A block in the post content that can be embedded within a column.

- `type`: `paragraph`
  - `formattedText` (list of ParagraphBlockTextSection, optional) — The formatted content of the paragraph.
  - `plaintext` (string, optional) — The plaintext content of the paragraph.
  - `textAlign` (enum, optional) — Legacy paragraph alignment field. Use `textAlignment` for new integrations.
    - Allowed values: `left`, `center`, `right`
  - `textAlignment` (enum, optional) — The text alignment of the paragraph (e.g., left, center, right).
    - Allowed values: `left`, `center`, `right`
  - `visibility_settings` (VisibilitySettings, optional) — Optional rules for when/where this block is shown, including dynamic content targeting via condition sets.
  - `visual_settings` (VisualSettings, optional) — Optional styling for borders, spacing, colors, etc.
- `type`: `image`
  - `imageUrl` (string, required) — The URL of the image.
  - `alt_text` (string, optional) — Alternative text for the image.
  - `caption` (string, optional) — A caption for the image.
  - `captionAlignment` (enum, optional) — The text alignment of the caption.
    - Allowed values: `left`, `center`, `right`
  - `imageAlignment` (enum, optional) — The text alignment of the image.
    - Allowed values: `left`, `center`, `right`
  - `title` (string, optional) — The title of the image.
  - `url` (string, optional) — The URL that the image should link to.
  - `visibility_settings` (VisibilitySettings, optional) — Optional rules for when/where this block is shown, including dynamic content targeting via condition sets.
  - `visual_settings` (VisualSettings, optional) — Optional styling for borders, spacing, colors, etc.
  - `width` (integer, optional) — The width of the image. Should be between 1 and 100.
- `type`: `button`
  - `href` (string, required) — The URL the button should use.
  - `text` (string, required) — The text content of the button.
  - `alignment` (enum, optional) — The text alignment of the button.
    - Allowed values: `left`, `center`, `right`
  - `size` (enum, optional) — The size of the button (e.g., small, normal, large).
    - Allowed values: `small`, `normal`, `large`
  - `target` (string, optional) — The target of the button (e.g., _blank).
  - `visibility_settings` (VisibilitySettings, optional) — Optional rules for when/where this block is shown, including dynamic content targeting via condition sets.
  - `visual_settings` (VisualSettings, optional) — Optional styling for borders, spacing, colors, etc.
- `type`: `heading`
  - `level` (enum, required) — The level of the header (e.g., 1, 2, 3, etc.).
    - Allowed values: `1`, `2`, `3`, `4`, `5`, `6`
  - `anchorHeader` (boolean, optional, default: true) — Whether the header should be an anchor header.
  - `anchorIncludeInToc` (boolean, optional, default: true) — Whether the header should be included in the table of contents.
  - `formattedText` (list of ParagraphBlockTextSection, optional) — The formatted content of the header, supporting links and inline styling.
  - `text` (string, optional) — The text content of the header. Ignored if `formattedText` is provided.
  - `textAlignment` (enum, optional) — The text alignment of the header (e.g., left, center, right).
    - Allowed values: `left`, `center`, `right`
  - `visibility_settings` (VisibilitySettings, optional) — Optional rules for when/where this block is shown, including dynamic content targeting via condition sets.
  - `visual_settings` (VisualSettings, optional) — Optional styling for borders, spacing, colors, etc.
- `type`: `rss`
  - `articleLayout` (enum, optional) — The layout of the articles from the feed.
    - Allowed values: `1-col`, `2-col`, `3-col`, `4-col`
  - `articlesToShow` (integer, optional) — The number of articles to show from the feed.
  - `ctaAlignment` (enum, optional) — The alignment of the call to action.
    - Allowed values: `Left`, `Center`, `Right`
  - `ctaStyle` (enum, optional) — The style of the call to action.
    - Allowed values: `CTA button`, `CTA link`, `Title as link`, `Thumbnail as link`, `Title and thumbnail as link`
  - `ctaText` (string, optional) — The text of the call to action. Applicable if ctaStyle is button or link.
  - `externalRssFeedId` (string, optional) — The ID of the external RSS feed.
  - `refreshOnSend` (boolean, optional) — Whether or not to refresh the contents from the RSS feed before sending out the email.
  - `rssFeedUrl` (string, optional) — The URL of the RSS feed.
  - `selectionMode` (enum, optional) — How to select feed articles, by count or time window.
    - Allowed values: `count`, `time`
  - `showArticleThumbnail` (boolean, optional) — Whether to show the article thumbnail.
  - `showArticleTitle` (boolean, optional) — Whether to show the article title.
  - `showAuthor` (boolean, optional) — Whether to show the author.
  - `showCategories` (boolean, optional) — Whether to show the categories.
  - `showContent` (boolean, optional) — Whether to show the article content.
  - `showCta` (boolean, optional) — Whether to show a call to action.
  - `showDescription` (boolean, optional) — Whether to show the article description.
  - `showPublishedDate` (boolean, optional) — Whether to show the date the article was published
  - `thumbnailPosition` (enum, optional) — The position of the thumbnail.
    - Allowed values: `Above Title`, `Below Title`, `Left of content`, `Right of content`, `Alternating Horizontally`
  - `timeWindowHours` (integer, optional) — Trailing window in hours when selectionMode is time.
  - `visibility_settings` (VisibilitySettings, optional) — Optional rules for when/where this block is shown, including dynamic content targeting via condition sets.
  - `visual_settings` (VisualSettings, optional) — Optional styling for borders, spacing, colors, etc.
- `type`: `advertisement`
  - `opportunity_id` (string, required) — The ID of the Advertisement opportunity.
  - `visibility_settings` (VisibilitySettings, optional) — Optional rules for when/where this block is shown, including dynamic content targeting via condition sets.
  - `visual_settings` (VisualSettings, optional) — Optional styling for borders, spacing, colors, etc.
- `type`: `advertisement_logo`
  - `opportunity_id` (string, required) — The ID of the advertisement opportunity whose logo to display.
  - `override_sponsor_text` (enum, required) — The sponsor text to display with the advertisement logo. Required.
    - Allowed values: `sponsored_by`, `together_with`, `in_partnership_with`, `presented_by`, `todays_sponsor`
  - `override_align` (enum, optional) — The logo alignment. Defaults to center.
    - Allowed values: `left`, `center`, `right`
  - `override_width` (integer, optional) — The logo width as a percentage. Must be greater than 0. Defaults to 100.
  - `visibility_settings` (VisibilitySettings, optional) — Optional rules for when/where this block is shown, including dynamic content targeting via condition sets.
  - `visual_settings` (VisualSettings, optional) — Optional styling for borders, spacing, colors, etc.

### ListBlockItemData

- `text` (string, optional) — The plain text content of the list item.
- `formattedText` (list of ParagraphBlockTextSection, optional) — The formatted content of the list item.

## Examples

**Request**

```json
{
  "header_image_url": "https://example.com/header.png"
}
```

**Response**

```json
{
  "data": {
    "created": 1700000000,
    "id": "reusable_block_00000000-0000-0000-0000-000000000000",
    "kind": "header",
    "name": "Brand header",
    "status": "active",
    "updated": 1700000000,
    "description": "The masthead every publication shares",
    "header_image_url": "https://media.beehiiv.com/uploads/asset/file/00000000/header.png"
  }
}
```

**SDK Code**

```python
import requests

url = "https://api.beehiiv.com/v2/workspaces/reusable_blocks/reusable_block_00000000-0000-0000-0000-000000000000"

payload = { "header_image_url": "https://example.com/header.png" }
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.patch(url, json=payload, headers=headers)

print(response.json())
```

```javascript
const url = 'https://api.beehiiv.com/v2/workspaces/reusable_blocks/reusable_block_00000000-0000-0000-0000-000000000000';
const options = {
  method: 'PATCH',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"header_image_url":"https://example.com/header.png"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.beehiiv.com/v2/workspaces/reusable_blocks/reusable_block_00000000-0000-0000-0000-000000000000"

	payload := strings.NewReader("{\n  \"header_image_url\": \"https://example.com/header.png\"\n}")

	req, _ := http.NewRequest("PATCH", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.beehiiv.com/v2/workspaces/reusable_blocks/reusable_block_00000000-0000-0000-0000-000000000000")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"header_image_url\": \"https://example.com/header.png\"\n}"

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.patch("https://api.beehiiv.com/v2/workspaces/reusable_blocks/reusable_block_00000000-0000-0000-0000-000000000000")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"header_image_url\": \"https://example.com/header.png\"\n}")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('PATCH', 'https://api.beehiiv.com/v2/workspaces/reusable_blocks/reusable_block_00000000-0000-0000-0000-000000000000', [
  'body' => '{
  "header_image_url": "https://example.com/header.png"
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.beehiiv.com/v2/workspaces/reusable_blocks/reusable_block_00000000-0000-0000-0000-000000000000");
var request = new RestRequest(Method.PATCH);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"header_image_url\": \"https://example.com/header.png\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = ["header_image_url": "https://example.com/header.png"] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.beehiiv.com/v2/workspaces/reusable_blocks/reusable_block_00000000-0000-0000-0000-000000000000")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PATCH"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```