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/
Specifies the time-to-live (TTL) in seconds for retrieving both incoming and outgoing messages. The maximum TTL value is determined by your subscription plan.
If set to true, this requires messages for the domain only be sent over a TLS connection. If a TLS connection cannot be established, Mailgun will not deliver the message.
If set to false, Mailgun will still try and upgrade the connection, but if Mailgun cannot, the message will be delivered over a plaintext SMTP connection.
The default value is false.
If set to true, the certificate and hostname will not be verified when trying to establish a TLS connection and Mailgun will accept any certificate during delivery of a message.
If set to false, Mailgun will verify the certificate and hostname. If either one can not be verified, a TLS connection will not be established.
The default value is false.
Enable or disable Automatic Sender Security. If enabled, requires setting DNS CNAME entries for DKIM keys instead of a TXT record. Domain must be reverified after changing this field. Defaults to false
Updates your open, click and unsubscribe URLs to use http or https. Value either http
or https
. Defaults to http. In order for https to work, you must have a valid cert created for your domain. See Domain Tracking for TLS cert generation.
This updates the web prefix used for a domain's tracking features. Must be a valid atom. Nothing will be updated if omitted. This impacts click, open, and unsubscribe tracking features.
Note: Updating the web prefix for a domain will require also updating the domain's DNS to include the CNAME record to match. For example, if you set the web prefix to zed
for the domain my-domain.com
, the corresponding CNAME zed.my-domain.com
will need to be created in your domain's dns zone.
- Mock server
https://documentation.mailgun.com/_mock/docs/mailgun/api-reference/openapi-final/v4/domains/{name}
- US Mailgun
https://api.mailgun.net/v4/domains/{name}
- EU Mailgun
https://api.eu.mailgun.net/v4/domains/{name}
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X PUT \
-u <username>:<password> \
'https://documentation.mailgun.com/_mock/docs/mailgun/api-reference/openapi-final/v4/domains/{name}' \
-H 'Content-Type: multipart/form-data' \
-F mailfrom_host=string \
-F message_ttl=0 \
-F require_tls=true \
-F skip_verification=true \
-F smtp_password=string \
-F spam_action=string \
-F use_automatic_sender_security=true \
-F web_scheme=string \
-F web_prefix=string \
-F wildcard=true
A 200 response
Domain object
Domain object
If true Mailgun will not verify the certificate and hostname when setting up a TLS connection
Action to take when a message is flagged as spam. Options are disabled
The subaccount ID the domain belongs to. This field is only present if the domain is associated with a subaccount
Custom tracking host for the domain used for tracking opens and clicks if configured
If true Mailgun manages DKIM key generation and DNS record configuration automatically
Indicates if the domain is a wildcard domain and can receive emails for any subdomain
Optional field containing additional details about the domain's disabled status if applicable
Optional field containing additional details about the domain's disabled status if applicable
If true incoming messages to this domain will be encrypted
List of DNS records required for receiving emails
{ "domain": { "created_at": "Thu, 13 Oct 2011 18:02:00 GMT", "id": "123456789012345678901234", "name": "example.com", "require_tls": true, "smtp_login": "postmaster@example.com", "spam_action": "disabled", "state": "active", "type": "sandbox", "use_automatic_sender_security": true, "web_prefix": "email", "web_scheme": "http" }, "receiving_dns_records": [ { … } ], "sending_dns_records": [ { … } ] }
- Mock server
https://documentation.mailgun.com/_mock/docs/mailgun/api-reference/openapi-final/v4/domains/{name}/verify
- US Mailgun
https://api.mailgun.net/v4/domains/{name}/verify
- EU Mailgun
https://api.eu.mailgun.net/v4/domains/{name}/verify
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X PUT \
-u <username>:<password> \
'https://documentation.mailgun.com/_mock/docs/mailgun/api-reference/openapi-final/v4/domains/{name}/verify'
A 200 response
Domain record information
Domain record information
If true Mailgun will not verify the certificate and hostname when setting up a TLS connection
Action to take when a message is flagged as spam. Options are disabled
The subaccount ID the domain belongs to. This field is only present if the domain is associated with a subaccount
Custom tracking host for the domain used for tracking opens and clicks if configured
If true Mailgun manages DKIM key generation and DNS record configuration automatically
Indicates if the domain is a wildcard domain and can receive emails for any subdomain
Optional field containing additional details about the domain's disabled status if applicable
Optional field containing additional details about the domain's disabled status if applicable
If true incoming messages to this domain will be encrypted
List of DNS records required for sending emails
List of Mailguns cached values for the DNS record
{ "message": "Domain DNS records have been updated", "domain": { "created_at": "Mon, 02 Jan 2006 15:04:05 MST", "id": "123456789012345678901234", "name": "example.com", "require_tls": true, "smtp_login": "postmaster@example.com", "spam_action": "disabled", "state": "unverified", "type": "sandbox", "use_automatic_sender_security": true, "web_prefix": "email", "web_scheme": "http", "disabled": { … } }, "sending_dns_records": [ { … } ], "receiving_dns_records": [ { … } ] }
- Mock server
https://documentation.mailgun.com/_mock/docs/mailgun/api-reference/openapi-final/v3/domains/{name}
- US Mailgun
https://api.mailgun.net/v3/domains/{name}
- EU Mailgun
https://api.eu.mailgun.net/v3/domains/{name}
- 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/v3/domains/{name}'
{ "message": "Domain will be deleted in the background" }
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