Skip to main content
POST
/
custom-templates
/
osm
Create OSM Template
curl --request POST \
  --url https://api-0{dc}.moengage.com/v1.0/custom-templates/osm \
  --header 'Authorization: Basic <encoded-value>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "basic_details": {
    "payload": "<html><body><h1>Your HTML Content Here</h1></body></html>",
    "template_type": "BANNER"
  },
  "meta_info": {
    "created_by": "testuser@moengage.com",
    "template_id": "123123123",
    "template_name": "Test",
    "template_version": "1"
  }
}
'
{
  "external_template_id": "d05a44f0-a7cf-471a-bcb6-63054800a367"
}

Rate Limit

The rate limit is 100 RPM. You can upload a maximum of 100 templates per minute.

Authorizations

Authorization
string
header
required

The API request is authenticated through Basic Authentication. This sends a Base64-encoded string containing your username and password with every API request.

It encodes a username:password string in Base64 and appends the encoded string with Basic . This string is included in the authorization header: {"Authorization: "Basic Base64_ENCODED_WORKSPACEID_APIKEY=="}

Follow these steps to obtain the username and password from the MoEngage Dashboard:

  1. Navigate to Settings > Account > APIs.
  2. Copy the following details:
    • Username: Under Workspace ID (earlier App ID), click the copy icon.
    • Password: In the API keys section, click the copy icon in the Campaign report/Business events/Custom templates/Catalog API tile.

Body

application/json

The details of the OSM template to be created.

basic_details
object
required

Details about the template, including its payload and template type.

meta_info
object
required

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

Response

Template created successfully.

external_template_id
string<uuid>

The unique ID assigned to the newly created template by MoEngage. This ID is used for subsequent updates or searches.