Update Content Block

Learn how to update an existing Content Block.

Overview

This endpoint enables you to update the content in a Content Block, such as a footer or a welcome message. You can only change/update the content in a Content Block using this API. You cannot update the Content Block type.

Base URL

Here is an example base URL:

https://{Region}.api.clevertap.com/v1/contentBlock/update

Region

Refer Region for more details.

HTTP Method

POST

Headers

Refer Headers for more details.

Body Parameters

The body is uploaded as a JSON payload.

ParameterTypeExample ValueDescriptionRequired?
idNumber123456789The unique identifier for the content block. This is mandatory for locating the specific block.Mandatory
contentStringcontent can be HTML or plain textThe updated content for the content block. You can only update the content in the existing Content Block type, that is, Text or HTML.Mandatory
updatedByString"[email protected]"The email address of the user making the update.Mandatory

Example Request

Here is an example cURL request to the Content Blocks API.

curl --location --request POST 'https://(region).clevertap.com/v1/contentBlock/update' \
--header 'X-CleverTap-Account-Id: WRK-485-456Z' \
--header 'X-CleverTap-Passcode: d23fae0ff9324f2aa071ac87a50abcfd' \
--header 'Content-Type: application/json' \
--data-raw ' {
    "id": 172594793336599,
    "content": "HTML",
    "updatedBy": "[email protected]"
  }'

Example Response

{"message":"Content Block updated","status":"success"

Expected errors

Response CodeResponse Error
403Content Blocks are not enabled on your account. Contact Support to access Content Blocks.
500Request couldn’t be processed due to a system error. Try again.
400We couldn't find any content blocks matching your search
200Content Block updated
400Content block ID consists of only numbers. Try again.
400Parameters entered for content block creation are invalid. Try again.

API FAQs

To understand the common queries and concerns related to CleverTap APIs, refer to API FAQs.