Update SMS Template API

Beta Callout

This is a Beta Feature. To enable it, please reach out to your CSM or mail us at support@moenage.com.

This API can be used to update an sms template by specifying its external template id. You can specify whether the updated version of the template can be used in active campaigns in the request.

API Endpoint

API Endpoint
PUT https://api-0X.moengage.com/v1.0/custom-templates/sms

Each customer is hosted on a different data center; you can find your data center number (value of X) by checking the data center and API endpoint mapping page.


Basic authentication sends a Base64-encoded string containing a username and password for all API requests.

Do the following when you are using the API for the first-time authentication:

  1. Navigate to Settings > APIs > TRANSACTION PUSH/REPORT Settings.
  2. Click on the Click here to show APP Secret link to see the APP Secret key.
  3. User name - APP ID and Password - API SECRET

For example, basic Authentication encodes a 'username:password' using base64 encoding and prepends it with the string 'Basic '. The string is passed in the authorization header as follows:

{"Authorization":"Basic bmF2ZWVua3VtYXI6bW9lbmdhZ2U="}

Request Headers

Key Required Sample Values Description



{"Content-Type": "application/json"}

Set the Content-Type header to application/json.



{"Authorization": "Basic bmF2ZWVua3VtYXI6bW9lbmdhZ2U=="}

This is the authentication parameter for access control and needs to be passed along with the request. The APP ID and API SECRET need to be picked up from the TRANSACTION PUSH API Settings in MoEngage Dashboard, and a Basic Authorization header needs to be created and set in the header. Navigation: Settings -> API -> General Settings -> TRANSACTION PUSH/REPORT SETTINGS section. For more information, refer to Authentication.

Request Body

Key Required Values Description
external_template_id Required String This field contains the unique identifier that is generated during the creation of the template.
update_campaigns Optional Boolean This field contains a flag that is used to update all the campaigns that are currently using the template being updated to the newer version(that is being updated in this request). The default value for this flag is false.
basic_details Required JSON Object

This field contains the basic details of the SMS template.

Structure of basic_details Object:

"basic_details": {
    "message": "Sample Template message"

The basic_details object contains the following fields:

  • message: This field contains the updated message template. It is a String and is mandatory.
meta_info Mandatory JSON Object

This field contains information about the template being created, such as the name, version, and id of the template and the creator's details.

Structure of meta_info:

"meta_info": {

    "template_name": "<template name>",
    "updated_by": "<email of the person updating the template>"

The meta_info object contains the following fields:

  • template_name - This field contains the name of the template being updated.
  • updated_by - This field contains the email id of the person updating the template.

Note: All the fields in the meta_info object are String fields and are mandatory.


Key Data Type Description
external_template_id String This field contains the unique template id corresponding to a successful template updation request.
error JSON Object

This field contains the reason for the request's failure.


 "error": {

    "code": "<error_code>", 

    "message": "<error_message>",

     "details": [],

    "request_id": "<unique identifier for the request>


The error object contains the following fields:

  • code - This field contains the error code that provides a brief explanation of the error and is a String. For example, 400 - Bad Request, 401- Authentication required, and so on. This field is present in the response only in the case of errors.
  • message - This field describes why the request has failed and is a String. For example, in the case of a duplicate request (400- Bad Request), the following message will be present: 'Duplicate - template_id and template_version'.
  • details - This is a List of the error details objects. Each object contains the following information:


             "code": "<Descriptive Error Code>",

             "target": "<Denotes the field causing the issue or a brief description of the error message in some cases >",

              "message": "<Descriptive Error Message>"


  • request_id -  This field contains the unique id pertaining to the request.

For example, in the case of a 400 request where the request is trying to update a template using an invalid template-id, the following error object is returned.

"error": {
"code": "400 Bad Request",
"message": "Invalid template id",
"details": [
"code": "Missing Value",
"target": "<template_id>",
"message": "<template_id>is invalid template id" 
"request_id": "cLCcgLQj"

Response Codes

Status Code Request State Description



This response is returned when the request is processed successfully. 


Bad Request

This response is returned when the required parameters are missing from the request or when the provided parameters are invalid.


Internal Server Error

This response is returned when the system runs into an unexpected error.

Rate Limit

The rate limit is 100 RPM.

Sample cURL Request

curl --location --request PUT 'https://api-{{0X}}.moengage.com/v1.0/custom-templates/sms' \
--header 'Content-Type: application/json' \
--header 'Authorization: Basic Base64_ENCODED_APP_ID_APP_SECRET_KEY' \
--data '{
    "external_template_id": "ID_OF_TEMPLATE_TO_BE_UPDATED",
    "update_campaigns": false,
    "basic_details": {
        "message": "MESSAGE"
    "meta_info": {
        "template_name": "NAME_OF_THE_TEMPLATE",
        "updated_by": "john.doe@yourbrand.com"

Sample Response

200 400 5XX
   "external_template_id": "eca024b7-a8ea-4f31-9154-5b80c85d18a9"

Postman Collections

We have made it easy for you to test the APIs. Click here to view it in Postman.

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

How can we improve this article?