curl --request POST \
--url https://api-{dc}.moengage.com/v1/external/campaigns/content-blocks \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--header 'MOE-APPKEY: <moe-appkey>' \
--data '
{
"name": "Summer_Sale_Header",
"label": "summer_sale_header_2025",
"description": "Header for all summer sale communications",
"content_type": "HTML",
"raw_content": "<h1>Huge Summer Sale!</h1>",
"images_used": [],
"status": "ACTIVE",
"created_by": "[email protected]",
"content_block_used": [],
"source": "CAMPAIGNS"
}
'{
"error": "Invalid Field Value",
"message": "Some of the field values are invalid",
"details": "nGpUNpDQ"
}{
"error": "Duplicate Label",
"message": "A content block with this label already exists in the workspace",
"details": "dPQnUgNp"
}{
"error": "Internal Server Error",
"message": "An unexpected error occurred on the server.",
"details": "SRV_ERR_123"
}Create Content Block
This API creates a content block in MoEngage.
Use the source field in the request body to specify the communication type for the content block:
"source": "CAMPAIGNS": Creates a content block for use in MoEngage campaigns."source": "INFORM": Creates a content block for use in Inform alerts.
curl --request POST \
--url https://api-{dc}.moengage.com/v1/external/campaigns/content-blocks \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--header 'MOE-APPKEY: <moe-appkey>' \
--data '
{
"name": "Summer_Sale_Header",
"label": "summer_sale_header_2025",
"description": "Header for all summer sale communications",
"content_type": "HTML",
"raw_content": "<h1>Huge Summer Sale!</h1>",
"images_used": [],
"status": "ACTIVE",
"created_by": "[email protected]",
"content_block_used": [],
"source": "CAMPAIGNS"
}
'{
"error": "Invalid Field Value",
"message": "Some of the field values are invalid",
"details": "nGpUNpDQ"
}{
"error": "Duplicate Label",
"message": "A content block with this label already exists in the workspace",
"details": "dPQnUgNp"
}{
"error": "Internal Server Error",
"message": "An unexpected error occurred on the server.",
"details": "SRV_ERR_123"
}Authorizations
Authentication is done via Basic Auth. This requires a base64-encoded string of your credentials in the format 'username:password'.
- Username: Use your MoEngage workspace ID (also known as the App ID). You can find it in the MoEngage dashboard at Settings > Account > APIs > Workspace ID (earlier app id).
- Password: Use your API Key, which you can find within the Campaign report/Business events/Custom templates/Catalog API/Inform Report tile.
For more information on authentication and getting your credentials, refer here.
Headers
This is the Workspace ID of your MoEngage account that must be passed with the request. You can find it in the MoEngage dashboard at Settings > Account > APIs > Workspace ID (earlier app id).
Body
The details of the content block to be created.
Name of the content block
Label to uniquely identify your content block
Content of the content block.
ContentApi.* Jinja calls are not supported in raw_content. Using them will cause the request to fail with a 400 error.
Type of the content block - HTML/ Plain Text
HTML, TEXT Email id of the user who is creating the content block
Shows the status of the content block
ACTIVE, DRAFT Description of the content block
Tags associated with the content block
In case, you are using nested content blocks, provide the names of the other content blocks used in this content block.
If you are not using nested content blocks, you can pass this as an empty array: content_block_used : []
An image referenced within the content block.
Show child attributes
Show child attributes
Communication type for the content block. Supported values are:
CAMPAIGNS: Creates a content block for use in MoEngage campaigns.INFORM: Creates a content block for use in Inform alerts. You cannot change the communication type after the content block is created.
CAMPAIGNS, INFORM Structured JSON representation of the content block's content, as used by the drag-and-drop builder on the MoEngage dashboard.
This field is optional and currently populated by the MoEngage dashboard for content blocks built visually. It is not required when creating a content block via this API using raw_content.
Response
Success. The response body is empty. To retrieve the ID of the newly created content block, use the Search Content Blocks API.