Skip to content

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/blocks

Response

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

ParameterTypeDescription
blockIdstringThe block ID

Response

Returns the block object.

SDK: sdk.blocks.getBlock(blockId)


Create Block

Create a new content block.

POST /api/blocks

Request Body

json
{
  "name": "Footer Content",
  "description": "Standard footer for all pages",
  "content": "<footer><p>&copy; 2025 My Company</p></footer>",
  "contentType": "html"
}
FieldTypeRequiredDescription
namestringYesThe name of the block
descriptionstringNoDescription of the block's purpose
contentstringYesThe block content (HTML or text)
contentTypestringNo"content" (default) or "html"

Response

Returns the created block object with generated _id.

SDK: sdk.blocks.create(block)


Update Block

Update an existing block.

PUT /api/blocks/{blockId}

Path Parameters

ParameterTypeDescription
blockIdstringThe block ID

Request Body

json
{
  "content": "<footer><p>&copy; 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.

SDK: sdk.blocks.update(blockId, changes)


Delete Block

Remove a content block.

DELETE /api/blocks/{blockId}

Path Parameters

ParameterTypeDescription
blockIdstringThe block ID

Response

Returns 200 OK on success.

SDK: sdk.blocks.remove(blockId)

Build SaaS Products Without Limits.