Update content block

You can use this API to update the content blocks in MoEngage. 

API Endpoint

PUT https://api-0X.moengage.com/v1/external/campaigns/content-blocks

MoEngage hosts each customer in a different data center; you can find your data center number (value of X) by checking the data center and API endpoint mapping here. Replace the value of 'X' in the endpoint URL based on your DataCenter.

Request Headers

Key Value Description
MOE-APPKEY
The App key for your MoEngage account.  You can access your MoEngage App key by navigating to Settings > APIs> APP key on your MoEngage Dashboard.
Content-Type application/json --

Request Body

Keys Type Value Description

name

Optional

String

Name of the content block  

id

Mandatory

String

Id of the content block, which we can get from the search API

status

Optional

String

Shows the status of the content block

raw_content

Mandatory

String

Raw content of the content block

description

Optional

String

Description of the content block 

updated_by

Mandatory

String

Email id of the user who updated the content block 

tag_ids

Optional

Array of ids

Tags associated with the content block

team_ids

Optional

Array of ids

Name of the teams for which the content block is enabled. This is only applicable to the accounts where Teams is enabled. For more information, refer to Teams.

content_block_used

Optional

Array of ids

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 : []

images_used

Optional

Array of ids

Images used in content block

Response

Status Code Request State Description Response Body

HTTP 202

Success

   

HTTP 

400

Bad Request

 

{

   "title": "Invalid Field Value",

   "description": "app_key - Some of the field values are invalid: app_key : None",

   "code": "nGpUNpDQ"

}

HTTP 5xx

Failure

Server issue

{ "title": "Internal Server Error", ... }

Sample cURL request

curl --location --request PUT 'https://api-0X.moengage.com/v1/external/campaigns/content-blocks' \
--header 'content-type: application/json' \
--header 'MOE-APPKEY: {{APP-KEY}} \
--data-raw '{
  "raw_content": "aa",
  "id": "634fdf4db9c206ba55b8223b",
  "updated_by": "test"
}'

 Sample Request Body

{
   "raw_content": "Edited Content",
  "id": "634fdf4db9c206ba55b8223b",
  "updated_by": "abc@gmail.com"
}

Attribute Mapping 

Key Type Data Type Description
id
Mandatory String ID of the content block that you want to update
name 
Mandatory String Name of the content block  
status Mandatory String Status of the content block - DRAFT/ACTIVE
raw_content Mandatory String Content of the content block 
content_type Mandatory String Type of the content block - HTML/ Plain Text 
description Optional String Description of the content block 
updated_by Mandatory String Email id of the user who is creating the content block 
tag_ids Optional Array of strings Tags associated to the content block
team_ids Optional  Array of strings Teams for which the content block should be available. Passing team id is mandatory if you are using multiple Teams. For more information, refer to Teams
content_block_used Mandatory Array of string 

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 : []

 

Was this article helpful?
0 out of 0 found this helpful