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/v3/{domain_name}/templates
- US Mailgun
https://api.mailgun.net/v3/{domain_name}/templates
- EU Mailgun
https://api.eu.mailgun.net/v3/{domain_name}/templates
- 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/v3/{domain_name}/templates?page=first&limit=0&p=string'
{ "items": [ { … }, { … } ], "paging": { "previous": "https://api.mailgun.net/v3/{domain}/templates?page=prev&p=template.0&limit=10", "first": "https://api.mailgun.net/v3/{domain}/templates?limit=10", "next": "https://api.mailgun.net/v3/{domain}/templates?page=next&p=template.2&limit=10", "last": "https://api.mailgun.net/v3/{domain}/templates?page=last&limit=10" } }
Name of the template being stored. Supports utf-8 characters and name will be down cased.
Initial tag of the created version. If the template parameter is provided and the tag is missing, the default value initial
is used.
Version comment. This is valid only if a new version is being created. (template parameter is provided.)
Key value JSON object of headers to be stored with the template. Where key is the header name and value is the header value. The header names From
, Subject
, and Reply-To
are the only ones currently supported. These headers will be inserted into the MIME at the time we attempt delivery.
Headers set at the message level will override headers set on the template. e.g. Setting the From header at the time of sending will override the From header saved on the template. Additionally, headers generated by templates are not reflected on the accepted event as they are not prepended to the message until the message is prepped for delivery. if a From header is not provided either in the message or template, we will default to postmaster@your-sending-domain.tld
- Mock server
https://documentation.mailgun.com/_mock/docs/mailgun/api-reference/openapi-final/v3/{domain_name}/templates
- US Mailgun
https://api.mailgun.net/v3/{domain_name}/templates
- EU Mailgun
https://api.eu.mailgun.net/v3/{domain_name}/templates
- 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/v3/{domain_name}/templates' \
-H 'Content-Type: multipart/form-data' \
-F name=string \
-F description=string \
-F createdBy=string \
-F template=string \
-F tag=string \
-F comment=string \
-F headers=string
{ "message": "template has been stored", "template": { "name": "template_name", "description": "This is the description of the template", "createdAt": "Sat, 12 Nov 1955 06:38:00 UTC", "createdBy": "user-supplied-value", "id": "46565d87-68b6-4edb-8b3c-34554af4bb77", "version": { … } } }
- Mock server
https://documentation.mailgun.com/_mock/docs/mailgun/api-reference/openapi-final/v3/{domain_name}/templates
- US Mailgun
https://api.mailgun.net/v3/{domain_name}/templates
- EU Mailgun
https://api.eu.mailgun.net/v3/{domain_name}/templates
- 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/{domain_name}/templates'
{ "message": "templates have been deleted" }