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 DIPPs
feature must be enabled for the account.
It is not allowed to delete a DIPP inherited from the parent account.
If the DIPP is delegated to subaccounts, those will also be updated.
If the replacement DIPP is specified, all domains linked to the deleted DIPP will be relinked to the replacement DIPP. The latter must contain at least one IP.
If the replacement IP is specified, all domains linked to the deleted DIPP will be unlinked, and the replacement IP will be assigned to them. It is not allowed to delete a DIPP inherited from the parent account and replace it with an IP (subaccounts do not explicitly manage their IPs).
The replacement IP must be a dedicated one; it can't belong to another DIPP. If a special value shared
is used, appropriate shared IPs will be used (the account must be eligible for shared IPs in this case).
Omitting both replacement DIPP and replacement IP is allowed only if the DIPP being deleted contains no IPs.
The processing of affected domains and subaccounts happens asynchronously after the endpoint returns a response.
- US Mailgun
https://api.mailgun.net/v3/ip_pools/{pool_id}
- EU Mailgun
https://api.eu.mailgun.net/v3/ip_pools/{pool_id}
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X DELETE \
-u <username>:<password> \
'https://api.mailgun.net/v3/ip_pools/{pool_id}?ip=string&pool_id=string' \
-H 'X-Mailgun-Account-Id: string' \
-H 'X-Mailgun-Requestor: string' \
-H 'X-Mailgun-Requestor-Client: string'
{ "allowed": { "dedicated": 1, "shared": 2 } }
Request
The account must have 'DIPPs' feature enabled.
It's not allowed to edit a DIPP inherited from the parent account.
IPs being added to the DIPP must be dedicated ones and belong to the account.
If IPs of the DIPP end up modified, and the DIPP is linked to domains, the domains will be updated asynchronously (after this endpoint returns response).
Returns an error if the passed parameters won't result in any changes.
- US Mailgun
https://api.mailgun.net/v3/ip_pools/{pool_id}
- EU Mailgun
https://api.eu.mailgun.net/v3/ip_pools/{pool_id}
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X PATCH \
-u <username>:<password> \
'https://api.mailgun.net/v3/ip_pools/{pool_id}' \
-H 'Content-Type: multipart/form-data' \
-H 'X-Mailgun-Account-Id: string' \
-H 'X-Mailgun-Requestor: string' \
-H 'X-Mailgun-Requestor-Client: string' \
-F add_ip=string \
-F description=string \
-F link_domain=string \
-F name=string \
-F remove_ip=string \
-F unlink_domain=string
{ "message": "success" }
- US Mailgun
https://api.mailgun.net/v3/ip_pools/{pool_id}/domains
- EU Mailgun
https://api.eu.mailgun.net/v3/ip_pools/{pool_id}/domains
- 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/{pool_id}/domains?limit=10&page=string' \
-H 'X-Mailgun-Account-Id: string'
{ "domains": [ { … }, { … } ], "paging": { "next": "http://api.mailgun.net/v3/ip_pools/686e71e8fcafa435bdb5be5f/domains?page=eyJj...", "first": "http://api.mailgun.net/v3/ip_pools/686e71e8fcafa435bdb5be5f/domains?page=eyJj..." } }