Skip to main content
POST
/
custom-templates
/
push
curl --request POST \
  --url https://api-0{data_center}.moengage.com/v1.0/custom-templates/push \
  --header 'Authorization: Basic <encoded-value>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "ANDROID": {
    "basic_details": {
      "app_name_color_code": "APP_NAME_COLOR_CODE",
      "notification_control_color": "Light/Dark",
      "background_color_code": "BG_COLOR_CODE",
      "title": "TITLE_OF_ANDROID_TEMPLATE",
      "message": "MESSAGE_OF_ANDROID_TEMPLATE",
      "summary": "SUMMARY",
      "image_url": "IMAGE_URL",
      "default_click_action": "DEEPLINKING/RICH_LANDING/NAVIGATE_TO_A_SCREEN",
      "default_click_action_value": "CLICK_ACTION_URL_HERE",
      "key_value_pairs": [
        {
          "key": "KEY",
          "value": " VALUE"
        }
      ]
    },
    "buttons": [
      {
        "btn_name": "NAME_OF_THE_BUTTON",
        "click_action_type": "NAVIGATE_TO_A_SCREEN/DEEPLINKING/RICH_LANDING/CALL/SHARE/COPY/SET_USER_ATTRIBUTE/TRACK_EVENT/CUSTOM_ACTION/SNOOZE/REMIND_LATER",
        "click_action_name": "VALID_CLICK_ACTION_NAME_HERE",
        "click_action_value": "CLICK_ACTION_URL_HERE"
      }
    ],
    "advanced": {
      "coupon_code": "COUPON_CODE",
      "icon_type_in_notification": "appicon/url",
      "large_icon_url": "LARGE_ICON_URL_HERE IF icon_type_in_notification is url",
      "auto_dismiss_notification": true,
      "dismissal_time_multiplier": "days/hours/minutes",
      "dismissal_time_value": 1,
      "make_notification_sticky": true,
      "dismiss_button_text": "DISMISS_BUTTON_TEXT_HERE"
    },
    "template_backup": {
      "title": "TITLE_OF_ANDROID_BACKUP_TEMPLATE",
      "message": "MESSAGE_OF_ANDROID_BACKUP_TEMPLATE",
      "summary": "SUMMARY",
      "image_url": "IMAGE_URL",
      "default_click_action": "DEEPLINKING/RICH_LANDING/NAVIGATE_TO_A_SCREEN",
      "default_click_action_value": "CLICK_ACTION_URL_HERE",
      "key_value_pairs": [
        {
          "key": "KEY",
          "value": " VALUE"
        }
      ]
    }
  },
  "IOS": {
    "basic_details": {
      "background_color_code": "BG_COLOR_CODE",
      "title": "TITLE_OF_IOS_TEMPLATE",
      "subtitle": "SUBTITLE_OF_IOS_TEMPLATE",
      "message": "MESSAGE_OF_IOS_TEMPLATE",
      "rich_media_value": "RICH_MEDIA_URL_HERE",
      "default_click_action": "DEEPLINKING/RICH_LANDING/NAVIGATE_TO_A_SCREEN",
      "default_click_action_value": "CLICK_ACTION_URL_HERE",
      "allow_bg_refresh": true
    },
    "buttons": [
      {
        "button_category": "CATEGORY_OF_BUTTON"
      }
    ],
    "advanced": {
      "coupon_code": "COUPON_CODE",
      "sound_file": "SOUND_FILE",
      "enable_ios_badge": true
    },
    "template_backup": {
      "title": "TITLE_OF_IOS_TEMPLATE",
      "subtitle": "SUBTITLE_OF_IOS_TEMPLATE",
      "message": "MESSAGE_OF_IOS_TEMPLATE",
      "rich_media_value": "RICH_MEDIA_URL_HERE",
      "default_click_action": "DEEPLINKING/RICH_LANDING/NAVIGATE_TO_A_SCREEN",
      "default_click_action_value": "CLICK_ACTION_URL_HERE",
      "allow_bg_refresh": true
    }
  },
  "meta_info": {
    "platform": [
      "ANDROID",
      "IOS"
    ],
    "template_style": "BASIC/STYLIZED",
    "template_id": 1234567890,
    "template_name": "NAME_OF_THE_TEMPLATE",
    "template_version": "VERSION_OF_THE_TEMPLATE",
    "created_by": "USER_CREATED"
  }
}
'
{
"external_template_id": "d05a44f0-a7cf-471a-bcb6-63054800a367"
}

Rate Limit

The rate limit is 100 RPM (Requests Per Minute).

Authorizations

Authorization
string
header
required

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.

Body

application/json

A JSON object containing the template definitions for desired platforms and metadata.

meta_info
object
required

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

ANDROID
object

This field contains the definition of the template for the Android platform.

IOS
object

This field contains the definition of the template for the iOS platform.

Response

This response is returned when the request is processed successfully.

external_template_id
string<uuid>

This field contains the unique template id corresponding to a successful template creation request and needs to be stored by you. This template id would be used for searching a specific template and updating it.

Example:

"d05a44f0-a7cf-471a-bcb6-63054800a367"