HTML blocks
View as MarkdownHTML blocks store reusable markup for workspace content.
On this page
- The HTML block object
- List HTML blocksGET
/api/v1/html-blocks - Retrieve an HTML blockGET
/api/v1/html-blocks/{id} - Create an HTML blockPOST
/api/v1/html-blocks - Update an HTML blockPATCH / PUT / POST
/api/v1/html-blocks/{id} - Delete an HTML blockDELETE
/api/v1/html-blocks/{id}POST/api/v1/html-blocks/{id}/delete
HTML blocks store reusable markup for workspace content.
Attributes
idinteger- Identifier assigned by the API.
namestring- Display name of the HTML block, up to 191 characters.
htmlstring- HTML content of the reusable block.
tscinteger- Creation time as a Unix timestamp in seconds.
tsuinteger- Last update time as a Unix timestamp in seconds.
/api/v1/html-blocksLists HTML block records in the workspace.
Permissions
Send your API key in X-API-Key. Required permissions are HTML blocks → Read.
Query parameters
qstring- Search by block name.
lengthinteger- Number of records to return.
startinteger- Zero-based offset.
drawstring- Optional request marker echoed in the response.
sortstring- Sort by id, name, tsc, or tsu. Prefix the field name with a minus sign for descending order.
orderstring- Direction for unprefixed sort fields. Use asc or desc.
Returns
Returns records in data, the counts before and after text search, and the echoed draw marker.
Errors
401- The API key is missing or invalid.
403- The API key lacks the required permission.
/api/v1/html-blocks/{id}Returns one HTML block by ID.
Permissions
Send your API key in X-API-Key. Required permissions are HTML blocks → Read.
Path parameters
idintegerRequired- ID of the HTML block.
Returns
The HTML block is returned in data.
Errors
401- The API key is missing or invalid.
403- The API key lacks the required permission.
404- The requested record was not found.
/api/v1/html-blocksCreates an HTML block.
Permissions
Send your API key in X-API-Key. Required permissions are HTML blocks → Write.
Body parameters
namestringRequired- Display name of the HTML block, up to 191 characters.
htmlstring- HTML content. Supply either html or body when creating a block.
bodystring- Alias for html. It is used when html is omitted.
Returns
The created HTML block is returned in data.
Errors
401- The API key is missing or invalid.
403- The API key lacks the required permission.
422- One or more fields failed validation.
/api/v1/html-blocks/{id}Updates an HTML block by ID.
Permissions
Send your API key in X-API-Key. Required permissions are HTML blocks → Write.
Path parameters
idintegerRequired- ID of the HTML block.
Body parameters
namestring- Display name of the HTML block, up to 191 characters.
htmlstring- HTML content. Supply either html or body when creating a block.
bodystring- Alias for html. It is used when html is omitted.
Returns
Returns a successful update response.
Errors
401- The API key is missing or invalid.
403- The API key lacks the required permission.
404- The requested record was not found.
422- One or more fields failed validation.
/api/v1/html-blocks/{id}/api/v1/html-blocks/{id}/deleteRemoves an HTML block from the workspace.
Permissions
Send your API key in X-API-Key. Required permissions are HTML blocks → Write.
Path parameters
idintegerRequired- ID of the HTML block.
Returns
Returns a successful removal response.
Errors
401- The API key is missing or invalid.
403- The API key lacks the required permission.
404- The requested record was not found.
400- The block could not be removed.