Blocks API
Endpoints for managing content blocks. Blocks are reusable content components that can be used across your application.
SDK equivalent:
sdk.blocks
List Blocks
Retrieve all available content blocks.
GET /api/blocksResponse
json
[
{
"_id": "block-id",
"name": "Footer Content",
"description": "Standard footer for all pages",
"content": "<footer>...</footer>",
"contentType": "html"
}
]SDK:
sdk.blocks.getList()
Get Block
Retrieve a specific block by its ID.
GET /api/blocks/{blockId}Path Parameters
| Parameter | Type | Description |
|---|---|---|
blockId | string | The block ID |
Response
Returns the block object.
Create Block
Create a new content block.
POST /api/blocksRequest Body
json
{
"name": "Footer Content",
"description": "Standard footer for all pages",
"content": "<footer><p>© 2025 My Company</p></footer>",
"contentType": "html"
}| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | The name of the block |
description | string | No | Description of the block's purpose |
content | string | Yes | The block content (HTML or text) |
contentType | string | No | "content" (default) or "html" |
Response
Returns the created block object with generated _id.
Update Block
Update an existing block.
PUT /api/blocks/{blockId}Path Parameters
| Parameter | Type | Description |
|---|---|---|
blockId | string | The block ID |
Request Body
json
{
"content": "<footer><p>© 2025 My Company, Inc.</p></footer>",
"description": "Updated footer content"
}Only the fields being changed need to be included.
Response
Returns the updated block object.
Delete Block
Remove a content block.
DELETE /api/blocks/{blockId}Path Parameters
| Parameter | Type | Description |
|---|---|---|
blockId | string | The block ID |
Response
Returns 200 OK on success.
