Newsletter Blocks API
API reference for composing newsletters. Add content blocks to newsletters, remove them, and reorder them programmatically.
Newsletter blocks are the join between newsletters and content blocks. They control which content appears in a newsletter and in what order.
Add a block to a newsletter
POST /api/v1/newsletters/:newsletter_id/blocks
| Field | Type | Required | Description |
|---|---|---|---|
content_block_id |
string | Yes | Public ID of the content block |
position |
integer | No | Insert position (1-based). Omit to add at end. |
Response:
json
{
"newsletter_block": {
"id": "nb_abc123",
"position": 3,
"content_block_id": "cb_def456",
"content_block_title": "CEO Update"
}
}
Remove a block from a newsletter
DELETE /api/v1/newsletters/:newsletter_id/blocks/:id
This removes the block from the newsletter but does not delete the underlying content block.
Reorder blocks
PATCH /api/v1/newsletters/:newsletter_id/blocks/reorder
| Field | Type | Required | Description |
|---|---|---|---|
block_ids |
array | Yes | Newsletter block public IDs in desired order |
{"block_ids": ["nb_third", "nb_first", "nb_second"]}
Blocks are assigned positions 1, 2, 3… in the order provided.