Skip to content

Create a limit threshold for an account

Request

Security
basicAuth
Bodyapplication/jsonrequired
namestringrequired

A user-friendly name for the limit.

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

The metric being monitored.

Enum ValueDescription
email_preview_success_count

The number of successful email previews

seed_test_count

The number of inbox placement tests

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.

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

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

A list of filters to apply to the limit.

periodstring

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

descriptionstring

A description of what the limit does.

curl -i -X POST \
  -u '<username>:<password>' \
  https://api.mailgun.net/v1/thresholds/limits \
  -H 'Content-Type: application/json' \
  -d '{
    "name": "email preview",
    "metric": "email_preview_success_count",
    "comparator": ">=",
    "limit": "2100",
    "dimension": "subaccount",
    "period": "1M"
  }'

Responses

A 200 response

Bodyapplication/json
idstring

The unique identifier for the limit.

parent_account_idstring

The parent account ID.

subaccount_idstring

The subaccount ID this limit belongs to.

account_groupstring

The group this account belongs to.

namestringrequired

A user-friendly name for the limit.

created_atstring, (date-time)required

Timestamp of when the limit was created.

updated_atstring, (date-time)

Timestamp of when the limit was last updated.

last_checkedstring, (date-time)

Timestamp of when the limit was last checked.

descriptionstring

A description of what the limit does.

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

A list of filters to apply to the limit.

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

The metric being monitored.

Enum ValueDescription
email_preview_success_count

The number of successful email previews

seed_test_count

The number of inbox placement tests

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 value of the limit.

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": "email preview", "created_at": "2026-02-01T10:30:00Z", "updated_at": "0001-01-01T00:00:00Z", "last_checked": "0001-01-01T00:00:00Z", "metric": "email_preview_success_count", "comparator": ">=", "limit": "2100", "dimension": "subaccount", "period": "1M" }