Update Content Block
post
/content_blocks/update
Use this endpoint to update an Email Content Block.
Rate limit
We apply the default Braze rate limit of 250,000 requests per hour to this endpoint, as documented in API rate limits.
Request body
1
2
Content-Type: application/json
Authorization: Bearer YOUR-REST-API-KEY
1
2
3
4
5
6
7
8
{
"content_block_id" : (required, string) Content block's API identifier.
"name": (required, string) Must be less than 100 characters,
"description": (optional, string) The description of the content block. Must be less than 250 character,
"content": (required, string) HTML or text content within content block,
"state": (optional, string) Choose `active` or `draft`. Defaults to `active` if not specified,
"tags": (optional, array of strings) Tags must already exist
}
Request parameters
Parameter | Required | Data Type | Description |
---|---|---|---|
content_block_id |
Required | String | Your content block’s API identifier. |
name |
Required | String | Name of the content block. Must be less than 100 characters. |
description |
Optional | String | Description of the content block. Must be less than 250 characters. |
content |
Required | String | HTML or text content within content blocks. |
state |
Optional | String | Choose active or draft . Defaults to active if not specified. |
tags |
Optional | Array of strings | Tags must already exist. |
Example request
1
2
3
4
5
6
7
8
9
10
11
curl --location --request POST 'https://rest.iad-01.braze.com/content_blocks/update' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer YOUR-REST-API-KEY' \
--data-raw '{
"content_block_id" :"content_block_id",
"name": "content_block",
"description": "This is my content block",
"content": "HTML or text content within block",
"state": "draft",
"tags": ["marketing"]
}'
Response
1
2
3
4
5
6
7
8
Content-Type: application/json
Authorization: Bearer YOUR-REST-API-KEY
{
"content_block_id": "newly-generated-block-id",
"liquid_tag": "generated-block-tag-from-content_block_name",
"created_at": "time-created-in-iso",
"message": "success"
}
Possible errors
The following table lists possible returned errors and their associated troubleshooting steps, if applicable.
Error | Troubleshooting |
---|---|
Content cannot be blank | |
Content must be a string | Make sure your content is encapsulated in quotes ("" ). |
Content must be smaller than 50kb | The content in your Content Block must be less than 50kb total. |
Content contains malformed liquid | The Liquid provided is not valid or parsable. Try again with valid Liquid or reach out to support. |
Content Block cannot be referenced within itself | |
Content Block description cannot be blank | |
Content Block description must be a string | Make sure your Content Block description is encapsulated in quotes ("" ). |
Content Block description must be shorter than 250 characters | |
Content Block name cannot be blank | |
Content Block name must be shorter than 100 characters | |
Content Block name can only contain alphanumeric characters | Content Block names can include any of the following characters: the letters (capitalized or lowercase) A through Z , the numbers 0 through 9 , dashes - , and underscores _ . It cannot contain non-alphanumeric characters like emojis, ! , @ , ~ , & , and other “special” characters. |
Content Block with this name already exists | Try a different name. |
Content Block name cannot be updated for active Content Blocks | |
Content Block state must be either active or draft | |
Active Content Block can not be updated to Draft. Create a new Content Block | |
Tags must be an array | Tags must be formatted as an array of strings, for example ["marketing", "promotional", "transactional"] . |
All tags must be strings | Make sure your tags are encapsulated in quotes ("" ). |
Some tags could not be found | To add a tag when creating a Content Block, the tag must already exist in Braze. |