Update OSM Template
curl --request PUT \
--url https://api-{dc}.moengage.com/v1.0/custom-templates/osm \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"external_template_id": "81e1a740-3e57-4c70-8ec7-ffc84d576498",
"update_campaigns": false,
"basic_details": {
"payload": "<html><body><h1>Updated HTML Content</h1></body></html>"
},
"meta_info": {
"template_name": "AD template updated API 1",
"template_id": "133434477456",
"template_version": "2",
"updated_by": "testuser@moengage.com"
}
}
'{
"external_template_id": "4a1afbc5-4c31-4f19-8c23-793e27af01aa"
}{
"error": {
"code": "400 Bad Request",
"message": "Validation failed because of invalid request data",
"details": [
{
"code": "MissingValue",
"target": "external_template_id",
"message": "external_template_id value is required but value is passed empty."
}
],
"request_id": "cTRlnJaG"
}
}{
"title": "Internal Server Error",
"message": "An unexpected error was encountered while processing this request. Please contact MoEngage Team"
}Update OSM Template
This API updates an OSM template as per your requirements.
PUT
/
custom-templates
/
osm
Update OSM Template
curl --request PUT \
--url https://api-{dc}.moengage.com/v1.0/custom-templates/osm \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"external_template_id": "81e1a740-3e57-4c70-8ec7-ffc84d576498",
"update_campaigns": false,
"basic_details": {
"payload": "<html><body><h1>Updated HTML Content</h1></body></html>"
},
"meta_info": {
"template_name": "AD template updated API 1",
"template_id": "133434477456",
"template_version": "2",
"updated_by": "testuser@moengage.com"
}
}
'{
"external_template_id": "4a1afbc5-4c31-4f19-8c23-793e27af01aa"
}{
"error": {
"code": "400 Bad Request",
"message": "Validation failed because of invalid request data",
"details": [
{
"code": "MissingValue",
"target": "external_template_id",
"message": "external_template_id value is required but value is passed empty."
}
],
"request_id": "cTRlnJaG"
}
}{
"title": "Internal Server Error",
"message": "An unexpected error was encountered while processing this request. Please contact MoEngage Team"
}Rate Limit
The rate limit is 100 RPM.Authorizations
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
The updated details for the OSM template.
The unique identifier generated by MoEngage during template creation.
Details about the template payload.
Show child attributes
Show child attributes
Updates template information such as name, version, and updater details.
Show child attributes
Show child attributes
Flag to update all campaigns currently using this template to the newer version.
true: All campaigns running with this template will be updated.false: A new version of the template is created; existing campaigns remain unchanged.
Response
Template updated successfully.
The unique ID of the updated template.
Was this page helpful?