The IP API endpoint allows you to access information regarding the IPs allocated to your Mailgun account that are used for outbound sending.
The behavior of the endpoint depends on the value of the ip
parameter. It can be
one of the following:
all
: the entire domain pool will be removed. As long as Tower is
concerned, such domain will no longer exist.ip_pool
: the DIPP which is currently linked to the domain will be
unlinked.Note that it's impossible to alter domain IPs if a DIPP is linked to the domain.
If the account is not eligible for shared IPs, additional rules apply:
The account must have 'DIPPs' feature enabled.
Either ip
or pool_id
query parameter must be specified, but not both.
If the special value shared
is used for the replacement IP, the account must be
eligible for shared IPs. In this case the system will assign a shared IP as the
replacement.
{- "message": "success"
}
The behavior of the endpoint depends on the value of the ip
parameter. It can be
one of the following:
all
: the entire domain pool will be removed. As long as Tower is
concerned, such domain will no longer exist.ip_pool
: the DIPP which is currently linked to the domain will be
unlinked.Note that it's impossible to alter domain IPs if a DIPP is linked to the domain.
If the account is not eligible for shared IPs, additional rules apply:
The account must have 'DIPPs' feature enabled.
Either ip
or pool_id
query parameter must be specified, but not both.
If the special value shared
is used for the replacement IP, the account must be
eligible for shared IPs. In this case the system will assign a shared IP as the
replacement.
{- "message": "success"
}
assignable_to_pool
in response lists which IPs can be assigned to DIPPs; this
field is present only if the account has 'DIPPs' feature enabled.
total_count
contains the number of items returned in items
(this depends on the
filters applied).
A 200 response
{- "assignable_to_pools": [
- "5.6.7.8"
], - "items": [
- "1.2.3.4",
- "5.6.7.8"
], - "total_count": 2,
- "details": [
- {
- "ip": "1.2.3.4",
- "is_on_warmup": true
}, - {
- "ip": "5.6.7.8"
}
]
}
The IP must belong to the account.
Matching domains are ordered by increasing id, then the limit
and skip
parameters
are applied.
If the search
parameter is present, it is used to limit the results to domains
whose names match the search query. The search query is split into words by
whitespace and punctuation, then the logical OR is applied.
{- "items": [
- {
- "domain": "one.example.com",
- "ips": [
- "1.2.3.4",
- "5.6.7.8"
]
}, - {
- "domain": "two.example.com",
- "ips": [
- "1.2.3.4"
]
}
], - "total_count": 2
}
The Dedicated IP Bands
feature must be enabled for the account.
The IP must be a dedicated one belonging to the account.
A 200 response
{- "message": "success"
}
This endpoint remains active for backwards compatibility. Do not use it in new code.
Field shared
in the response is deprecated and should not be used.
A 200 response
{- "allowed": {
- "dedicated": 1,
- "shared": 2
}
}
A new IP can be assigned only if billing limits allow that.
A 200 response
{- "message": "success"
}