curl --request POST \
--url https://api-{dc}.moengage.com/v1.0/alerts/send \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--header 'MOE-APPKEY: <api-key>' \
--data '
{
"alert_id": "636b77e6e2cf83277195fb60",
"alert_reference_name": "Demo_ID",
"user_id": "USER_12345",
"transaction_id": "TXN_ABCDEF123",
"payloads": {
"SMS": {
"recipient": "1234567890"
}
}
}
'{
"message": "Successfully Received",
"request_id": "a1b2c3d4e5f6",
"SMS": {
"message": "Successfully sent",
"err_code": "NA",
"status_code": 200000
},
"EMAIL": {
"message": "Successfully sent",
"err_code": "NA",
"status_code": 200000
},
"PUSH": {
"message": "Successfully sent",
"err_code": "NA",
"status_code": 200000
}
}{
"message": "Invalid Alert ID",
"err_code": "BAD_REQUEST",
"status_code": 120002
}{
"message": "Invalid App Key or Basic Auth",
"err_code": "UNAUTHORIZED",
"status_code": 120001
}{
"message": "Duplicate Transaction ID",
"err_code": "DUPLICATE_REQUEST_RECEIVED",
"status_code": 120105
}{
"message": "Too many requests",
"err_code": "Rate Limit",
"status_code": 140110
}{
"message": "Unexpected error occurred",
"err_code": "Internal Server Error",
"status_code": 140109
}Send Transactional Alert
This API is used to trigger a transactional message/alert to the user via one or more configured channels.
curl --request POST \
--url https://api-{dc}.moengage.com/v1.0/alerts/send \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--header 'MOE-APPKEY: <api-key>' \
--data '
{
"alert_id": "636b77e6e2cf83277195fb60",
"alert_reference_name": "Demo_ID",
"user_id": "USER_12345",
"transaction_id": "TXN_ABCDEF123",
"payloads": {
"SMS": {
"recipient": "1234567890"
}
}
}
'{
"message": "Successfully Received",
"request_id": "a1b2c3d4e5f6",
"SMS": {
"message": "Successfully sent",
"err_code": "NA",
"status_code": 200000
},
"EMAIL": {
"message": "Successfully sent",
"err_code": "NA",
"status_code": 200000
},
"PUSH": {
"message": "Successfully sent",
"err_code": "NA",
"status_code": 200000
}
}{
"message": "Invalid Alert ID",
"err_code": "BAD_REQUEST",
"status_code": 120002
}{
"message": "Invalid App Key or Basic Auth",
"err_code": "UNAUTHORIZED",
"status_code": 120001
}{
"message": "Duplicate Transaction ID",
"err_code": "DUPLICATE_REQUEST_RECEIVED",
"status_code": 120105
}{
"message": "Too many requests",
"err_code": "Rate Limit",
"status_code": 140110
}{
"message": "Unexpected error occurred",
"err_code": "Internal Server Error",
"status_code": 140109
}Rate Limit
The default rate limit is 10K RPM.Authorizations
Send your Workspace ID and API key as a base64-encoded username:password string.
- Username: Your MoEngage Workspace ID (also known as the App ID), from Settings > Account > API keys.
- Password: An API key generated from Settings > Account > API keys. Click + Create new key, set Authentication type to Basic Auth, select the Inform group, and assign the Send Alerts permission. The legacy Inform key (auth type Basic Auth (Legacy)) also works.
Refer to API Key Dashboard for details on creating and managing API keys.
Body
The payload containing the alert identifier, transaction details, and recipient information for each channel.
This is the unique identifier denoting the transaction for which the Alert is being sent to the user. This information is maintained by the brand and is passed in the request. The maximum length allowed for this field is 50 characters.
The Inform API supports idempotency using this parameter. If a request contains a transaction_id and is successful and another request with the same transaction_id is received within 5 minutes of the successful request, the new request would be deemed a duplicate one.
This field uniquely identifies the Alert to be sent to the user. For the staging endpoint, use the test alert id and for the live endpoint, use the alert id. For more information, refer to Live and Test Alerts.
Response
Request has been received and processed. The response body contains the status for the overall request and for each individual channel.
Note: Reach out to your Customer Success Manager to enable sending the channel level details as part of your API response.