Skip to main content
The Webhook alert destination allows you to receive real-time alert notifications by sending an HTTP POST request with a detailed JSON payload to a URL you specify. This guide details the structure of the JSON payload and provides sample requests for different alert types.
When a configured alert is triggered, MoEngage sends an HTTP POST request to your designated webhook URL, enabling seamless integration with your internal systems, monitoring tools, or third-party services.

MoEngage × Webhook

The Webhook integration allows you to configure a generic HTTP endpoint as an alert destination. This is designed for advanced users who want to route MoEngage alerts to internal systems, third-party monitoring tools, or data warehouses that support HTTP POST requests. When an alert is triggered, MoEngage sends a detailed JSON payload containing all relevant alert data to your specified URL. With this integration, you can do the following:
  • Programmatically ingest alert data into your own infrastructure.
  • Trigger custom automated workflows in third-party systems based on MoEngage alerts.
  • Securely validate alert authenticity using digital signatures.

Use Cases

Integrating Webhooks as an alert destination supports the following use cases:
  • Incident management integration: Automatically create tickets in tools like PagerDuty, OpsGenie, or Jira when critical alerts (for example, Token Expiry or Delivery Rate drops) occur.
  • Custom dashboards: Ingest alert statistics into internal data visualization tools (like Grafana or Tableau) for long-term trend analysis.
  • Automated remediation: Trigger server-side scripts to pause campaigns or adjust settings automatically when specific alert thresholds are breached.

Integration

Before you begin the configuration, ensure you have the following:
  • A publicly accessible Endpoint URL that accepts HTTP POST requests and JSON bodies.
  • Technical resources to parse the JSON payload and (optionally) validate the SHA-256 signature for security.
  • Access to your MoEngage workspace with permissions to configure alert management.

Set Up Your Webhook URL

To set up a webhook destination, you must provide a URL. Your URL must be a publicly accessible endpoint that accepts HTTP POST requests with a JSON body.
Your webhook URL is the address of your application or service that will listen for and process the incoming alert notifications.
After obtaining your URL using one of these methods, enter it in the Webhook URL field when configuring the alert destination.

Webhook Payload Structure

All webhook notifications follow a consistent JSON structure. The table below describes each field in the payload. Note that some fields, particularly within the entity_data object, are specific to certain alert types.

entity_data.content Object

The following table describes the possible fields in each object in the entity_data.content array.

Verify the Webhook Signature

To ensure that webhook requests are authentic and originate from MoEngage, we include a digital signature in the request headers.
Info It is recommended to validate this signature on your server to prevent unauthorized access and ensure data integrity.
The signature is passed in the Signature HTTP header. It is generated by creating a SHA-256 hash of your API key concatenated with the raw request body. Generate and Verify the Signature
  1. Get your Campaign Report API Key: You can find this key in your MoEngage UI by navigating to Settings > Account > APIs.
  2. Prepare the Signature String: Concatenate your Campaign Report API key, a pipe character (|), and the raw JSON request body.
    Format: YOUR_API_KEY + "|" + RAW_REQUEST_BODY
  3. Calculate the Hash: Create a SHA-256 hash of the signature string and encode it as a hexdigest.
  4. Compare Signatures: Compare the hash you generated with the value from the Signature header in the incoming request. If they match, the request is authentic.
Example: Generate the Signature in Python

Sample Payloads and cURL Requests

Below are samples of cURL commands demonstrating the POST request and JSON payload your webhook endpoint will receive. Replace 'https://your-webhook-url.com/endpoint' with your actual endpoint URL.

Campaign Stats (CAMPAIGN_STATS)

Absolute Threshold Alert

This alert triggers when a metric crosses a fixed value.

Relative Threshold Alert (with Moving Average)

This alert triggers when a metric deviates from its historical moving average. A moving average is the average of a metric over a specific number of past periods (for example, the last 7 days), which helps identify significant deviations from recent performance trends.

Flow Stats (FLOW_STATS)

These alerts are similar to Campaign Stats but focus on flow-level metrics.

Campaign Expiry (CAMPAIGN_EXPIRY)

This alert notifies you when campaigns are nearing their expiration date.

APNS Token Expiry (APNS_TOKEN_EXPIRY)

This alert warns you when your Apple Push Notification Service (APNS) token is about to expire. Note that this payload does not contain an entity_data object.

Facebook Token Expiry (FACEBOOK_TOKEN_EXPIRY)

This alert warns you when your Facebook token is about to expire. This payload also does not contain an entity_data object.

Integrate Alert Management via Webhook URL

  1. On the left navigation menu of your MoEngage UI, click App marketplace. slackkkkkkk.png
  2. On the App marketplace page, click Alert management , and then select Webhooks. webhooksssss1.png
  3. On the Webhooks page, click the Integrate tab. webhooksss.png
  4. On the Integrate tab, enter the following details:
    • Connection name : Enter the connection name.
    • Connection URL : Enter the Webhook URL created as mentioned here.
  5. Click Connect. webhooksfinallllll.png
  6. After the connection is defined, you can select the defined new destination from the Send Alerts On list while creating an alert on the Alert management page. dashboard4.png
  7. After adding the destinations, you can view the defined alert destinations on the Alert management page. slackemailfinal.png