Skip to content

Update a send alert

Request

Updates the configuration of an existing send alert.

NOTE: This endpoint performs a full replacement (PUT) of the alert resource. To update specific fields like 'alert_channels' without losing existing configuration, you should first fetch the current alert object via a GET request.

Use the attributes from the existing alert to populate the request body, modifying only the 'alert_channels' array (or other desired fields) before sending the PUT request. Omitting existing attributes may result in validation errors or the loss of current settings.

Security
basicAuth
Path
namestringrequired

Threshold name that identifies this threshold

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

Responses

A 200 response

Bodyapplication/json
messagestringrequired

Response message

Response
{ "message": "string" }