To update an existing block, send a PUT request to the endpoint with the block ID in the URL.
PUT /api/blocks/42
Include the block details in the HTTP request body according to the specified Content-Type. The type field is required.
| Parameter | Type | Required | Description |
|---|---|---|---|
type |
string | Yes | Type of the block (e.g., "template", "html", "menu") |
name |
string | No | Name of the block |
properties |
object | No | Block-specific properties |
lang_code |
string | No | Language code for multilingual stores |
{
"type": "template",
"name": "Example Template 2",
"properties": {
"template": "blocks/static_templates/my_account_links.tpl"
}
}
This request changes the block type to "Template", and updates both the name and template path of the block.
lang_code parameter. For example, adding "lang_code": "ru" to your JSON will only change the name for the Russian language.
{
"block_id": "42"
}
| Status Code | Description |
|---|---|
200 OK |
Block was updated successfully |
400 Bad Request |
Invalid request parameters |
404 Not Found |
Block with the specified ID does not exist |