Mailgun API (0.0.0)
Mailgun API defined by OpenAPI Specification (OAS) 3.1.0
https://api.mailgun.net/
https://api.eu.mailgun.net/
Domain Tracking
Mailgun offers tracking for clicks, unsubscribes, and opens, with optional HTTPS protocol support on tracking URLs. To enable HTTPS, Mailgun uses Let’s Encrypt with HTTP-01 challenges through your existing tracking CNAME record to issue a TLS certificate. This setup also includes support for HTTP Strict Transport Security (HSTS) for enhanced security.
Stats
Mailgun collects many different events and generates event statistics which are available in your Control Panel. This data is also available via our stats API endpoint.
WARNING: This API is deprecated in favor of our Metrics API.
Events
Mailgun keeps track of every inbound and outbound message event and stores this data for at least 3 days.
WARNING: This API is deprecated in favor of our Logs API.
Bounces
Bounces - Bounce list stores events of delivery failures due to permanent recipient mailbox errors such as non-existent mailbox. Soft bounces (for example, mailbox is full) and other failures (for example, ESP rejects an email because it thinks it is spam) are not added to the list.
Allowlist
The allowlist API provides the ability to allowlist specific addresses from being added to bounce list. You can allowlist by domain name (i.e example.com) or by specific address (i.e. alice@example.com). Mailgun doesn’t add an address to bounce list if the address is allowlisted. This API is very useful if you test against your private services and don’t want to constantly clean up bounce lists
Request
The behavior of the endpoint depends on the value of the ip
parameter. It can be one of the following:
- a valid IP address: this IP address will be removed from the domain pool.
- string
all
: the entire domain pool will be removed. As far as the system is concerned, such domain will no longer exist. - string
ip_pool
: the DIPP which is currently linked to the domain will be unlinked.
Removing An IP
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:
- removing the last IP from the domain is not allowed;
- if all of the remaining dedicated IPs are on warmup, an extra IP might be added to the domain pool.
Unlinking The DIPP
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.
- US Mailgun
https://api.mailgun.net/v3/domains/{name}/pool/{ip}
- EU Mailgun
https://api.eu.mailgun.net/v3/domains/{name}/pool/{ip}
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X DELETE \
-u <username>:<password> \
'https://api.mailgun.net/v3/domains/{name}/pool/{ip}?ip=string&pool_id=string' \
-H 'X-Mailgun-Account-Id: string' \
-H 'X-Mailgun-Requestor: string' \
-H 'X-Mailgun-Requestor-Client: string'
{ "message": "success" }
Request
Description
Lists all dedicated IP pools of the account. For each pool returns its basic properties (name, description, the list of IPs) and indicates whether the pool is linked to any domains and whether it's an inherited one. Only one pool can be inherited from the parent account.
- US Mailgun
https://api.mailgun.net/v3/ip_pools
- EU Mailgun
https://api.eu.mailgun.net/v3/ip_pools
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X GET \
-u <username>:<password> \
https://api.mailgun.net/v3/ip_pools
{ "ip_pools": [ { … } ], "message": "success" }
- US Mailgun
https://api.mailgun.net/v3/ip_pools
- EU Mailgun
https://api.eu.mailgun.net/v3/ip_pools
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X POST \
-u <username>:<password> \
https://api.mailgun.net/v3/ip_pools \
-H 'Content-Type: multipart/form-data' \
-F description=string \
-F ip=string \
-F name=string
{ "message": "success", "pool_id": "658041ae44842b99ee2eaa1b" }