Skip to content

Create a send alert for an account

Request

Security
basicAuth
Bodyapplication/jsonrequired
namestringrequired

A user-friendly name for the alert.

metricstring(github.com-mailgun-thresholds-api-Metric)required

The metric being monitored.

Enum ValueDescription
hard_bounce_rate

Hard bounce rate

temporary_fail_rate

Temporary fail rate

delivered_rate

Delivery rate

complained_rate

Complaint rate

comparatorstring(github.com-mailgun-thresholds-api-MetricComparator)required

The comparison operator.

Enum ValueDescription
=

Equal

!=

Not equal

<

Less than

<=

Less than or equal

>

Greater than

>=

Greater than or equal

limitstringrequired

The threshold limit for the alert.

dimensionstring(github.com-mailgun-thresholds-api-Dimension)required

The dimension to apply to the metric.

Enum ValueDescription
domain

Sender domain name, e.g. example.com

ip

Sending IP address

ip_pool

IP Pool ID

recipient_provider

Recipient Provider, e.g. Gmail, Other US, etc.

subaccount

Subaccount name

alert_channelsArray of strings

A list of alert channels to notify.

filtersArray of objects(github.com-mailgun-thresholds-api-Filter)

A list of filters to apply to the alert.

periodstring

The time period for the metric aggregation in the format of '1h' '1d'.

descriptionstring

A description of what the alert does.

curl -i -X POST \
  -u '<username>:<password>' \
  https://api.mailgun.net/v1/thresholds/alerts/send \
  -H 'Content-Type: application/json' \
  -d '{
    "name": "hard bounce rate",
    "metric": "hard_bounce_rate",
    "comparator": "<",
    "limit": ".99",
    "dimension": "subaccount",
    "alert_channels": [
      "email",
      "webhook",
      "slack"
    ],
    "period": "1h"
  }'

Responses

A 200 response

Bodyapplication/json
idstring

The unique identifier for the alert.

parent_account_idstring

The parent account ID.

subaccount_idstring

The subaccount ID this alert belongs to.

account_groupstring

The group this account belongs to.

namestringrequired

A user-friendly name for the alert.

created_atstring, (date-time)required

Timestamp of when the alert was created.

updated_atstring, (date-time)

Timestamp of when the alert was last updated.

last_checkedstring, (date-time)

Timestamp of the alert was last checked.

descriptionstring

A description of what the alert does.

alert_channelsArray of strings

A list of alert channels to notify.

filtersArray of objects(github.com-mailgun-thresholds-api-Filter)

A list of filters to apply to the alert.

metricstring(github.com-mailgun-thresholds-api-Metric)required

The metric being monitored.

Enum ValueDescription
hard_bounce_rate

Hard bounce rate

temporary_fail_rate

Temporary fail rate

delivered_rate

Delivery rate

complained_rate

Complaint rate

comparatorstring(github.com-mailgun-thresholds-api-MetricComparator)required

The comparison operator.

Enum ValueDescription
=

Equal

!=

Not equal

<

Less than

<=

Less than or equal

>

Greater than

>=

Greater than or equal

limitstringrequired

The threshold limit for the alert.

dimensionstring(github.com-mailgun-thresholds-api-Dimension)required

The dimension to apply to the metric.

Enum ValueDescription
domain

Sender domain name, e.g. example.com

ip

Sending IP address

ip_pool

IP Pool ID

recipient_provider

Recipient Provider, e.g. Gmail, Other US, etc.

subaccount

Subaccount name

periodstring

The time period for the metric aggregation in the format of '1h' '1d'.

Response
{ "id": "915ff385-0a9a-4087-86d5-6727ea7d9b49", "parent_account_id": "12345", "subaccount_id": "67890", "name": "delivery rate", "created_at": "2026-02-01T10:30:00Z", "updated_at": "2026-02-01T10:30:00Z", "last_checked": "2026-02-01T10:30:00Z", "alert_channels": [ "email", "webhook", "slack" ], "metric": "delivered_rate", "comparator": "<", "limit": ".99", "dimension": "subaccount", "period": "1h" }