Mailgun API (0.0.0)
Mailgun API defined by OpenAPI Specification (OAS) 3.1.0
https://documentation.mailgun.com/_mock/docs/mailgun/api-reference/openapi-final/
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
- Mock server
https://documentation.mailgun.com/_mock/docs/mailgun/api-reference/openapi-final/v1/keys
- US Mailgun
https://api.mailgun.net/v1/keys
- EU Mailgun
https://api.eu.mailgun.net/v1/keys
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X GET \
-u <username>:<password> \
'https://documentation.mailgun.com/_mock/docs/mailgun/api-reference/openapi-final/v1/keys?domain_name=string&kind=domain'
{ "items": [ { … } ], "total_count": 1 }
Type of api key ('domain', 'user', or 'web'). Defaults to 'user' if not provided. Note: web keys are not subject to IP whitelisting and have a default/maximum validity period of 1 day.
Enum Value | Description |
---|---|
domain | Create api key of type 'domain' |
user | Create api key of type 'user' |
web | Create api key of type 'web' |
Key role ('admin', 'basic' [use in place of analyst], 'sending' [use with keys of domain kind], 'support', or 'developer')
- Mock server
https://documentation.mailgun.com/_mock/docs/mailgun/api-reference/openapi-final/v1/keys
- US Mailgun
https://api.mailgun.net/v1/keys
- EU Mailgun
https://api.eu.mailgun.net/v1/keys
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X POST \
-u <username>:<password> \
https://documentation.mailgun.com/_mock/docs/mailgun/api-reference/openapi-final/v1/keys \
-H 'Content-Type: multipart/form-data' \
-F email=string \
-F domain_name=string \
-F kind=domain \
-F expiration=0 \
-F role=string \
-F user_id=string \
-F user_name=string \
-F description=string
{ "key": { "description": "api key", "kind": "domain", "role": "sending", "created_at": "2006-01-02T15:04:05", "updated_at": "2006-01-02T15:04:05", "domain_name": "example.com", "id": "f2153fd0-f1277777", "user_name": null, "requestor": null, "is_disabled": false }, "message": "great success" }
- Mock server
https://documentation.mailgun.com/_mock/docs/mailgun/api-reference/openapi-final/v1/keys/{key_id}
- US Mailgun
https://api.mailgun.net/v1/keys/{key_id}
- EU Mailgun
https://api.eu.mailgun.net/v1/keys/{key_id}
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X DELETE \
-u <username>:<password> \
'https://documentation.mailgun.com/_mock/docs/mailgun/api-reference/openapi-final/v1/keys/{key_id}'
{ "message": "key deleted" }