Send alerts

Create an alert rule

Changed on

Creates a rule that watches the bounce, complaint, or delivery rate of each of your sending domains. Nylas checks every rule every 5 minutes. When a domain's rate over the last window_hours crosses the threshold, Nylas sends an alert.triggered notification. Subscribe to that trigger with a webhook to receive it. Rules cover Agent Account and Transactional send messages only.

post/v3/alerts/send

Request

Request body

metric'bounce_rate' | 'complaint_rate' | 'delivery_rate' required

The rate to watch. bounce_rate and complaint_rate fire when the rate goes above the threshold, and delivery_rate fires when it goes below.

thresholdnumber required

The threshold, as a percentage with up to 2 decimal places. For bounce_rate and complaint_rate, at least 0 and less than 100. For delivery_rate, more than 0 and at most 100. The rule fires only when the rate is past the threshold, not equal to it.

window_hoursinteger required

How many hours of sending the rate covers, from 1 to 24.

min_volumeinteger

The minimum number of messages a sending domain must send in the window before the rule can fire. Use it to avoid alerts on low volume, where one bounce is a high rate.

Example request

{
  "metric": "bounce_rate",
  "threshold": 5,
  "window_hours": 1,
  "min_volume": 50
}

Response

Created. Returns the new alert rule.

request_idstring

The request ID.

Example response

{
  "data": {
    "id": "8069c06e-a4c0-4bfa-9535-0f286575cc0e",
    "application_id": "26302083-12ae-4f38-91fe-6cba93da03ee",
    "metric": "bounce_rate",
    "direction": "above",
    "threshold": 5,
    "window_hours": 1,
    "min_volume": 50,
    "created_at": 1792785235,
    "updated_at": 1792785235
  }
}

Changes