Create Content Block
POST https://{{instance_url}}/content_blocks/create
This endpoint will create a Content Block.
Request Parameters
| Parameter | Required | Data Type | Description | 
|---|---|---|---|
| name | Yes | String | Must be less than 100 characters. | 
| description | No | String | The description of the content block. Must be less than 250 characters. | 
| content | Yes | String | HTML or text content within Content Block. | 
| state | Optional | String | Choose activeor draft. Defaults to activeif not specified. | 
| tags | No | Array of strings | Tags must already exist. | 
Successful Response Properties
{
  "content_block_id": "newly-generated-block-id",
  "liquid_tag": "generated-block-tag-from-name",
  "created_at": "time-created-in-iso",
  "message": success
}
Possible Errors
- Content cannot be blank.
- Content must be a string.
- Content must be smaller than 51200.The content in your content block must be less than 50kb total.
- Unable to parse liquid string.The liquid provided is not valid or parsable. Please try again 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.
- Content block description must be shorter than 250Your content block description must be less than 250 characters.
- Content Block name cannot be blank.
- Content Block name must be a shorter than 100.Your 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)- Athrough- Z, the numbers- 0through- 9, dashes- -, and underscores- _. It cannot contain non-alphanumeric characters like emojis,- !,- @,- ~,- &, and other- special characters.
- Content Block with this name already exists.
- Content Block state must be either Active or Draft.
- Tags must be an array.
- All Tags must be Strings.
- Some Tags could not be found.
Request Body
{"name"=>"content_block", "description"=>"This is my content block", "content"=>"HTML content within block", "state"=>"draft", "tags"=>["marketing"]}
HEADERS
| Key | Datatype | Required | Description | 
|---|---|---|---|
| Content-Type | string | ||
| Authorization | string |