Get the list of domains. Can be filtered by state or authority. Sorting is optional. The list is paginated and limited to 1000 items per page.
{- "total_count": 1,
- "items": [
- {
- "created_at": "Mon, 02 Jan 2006 15:04:05 MST",
- "id": "1",
- "name": "example.com",
- "state": "unverified",
- "type": "custom",
- "web_prefix": "email",
- "disabled": {
- "code": "blacklisted",
- "note": "for debugging",
- "permanently": true,
- "reason": "bad customer"
}
}
]
}
Creates a domain for sending emails
name required | string The name of the new domain |
dkim_host_name | string Set the DKIM host name for the domain that is being created. Note, the value must be a valid domain name, and can be the domain name being created, a subdomain of the domain being created, or the root domain. This parameter cannot be used in conjunction with force_dkim_authority or force_root_dkim_host. |
dkim_key_size | string The size of the new domain's DKIM key. Shall be either 1024 or 2048. |
dkim_selector | string Explicitly set the value of the DKIM selector for the domain being created. If the domain key does not already exist, one will be created. The selector must be a valid atom per RFC2822. e.g valid value https://datatracker.ietf.org/doc/html/rfc2822#section-3.2.4 |
encrypt_incoming_message | boolean Enable encrypting incoming messages for the given domain. This cannot be altered via API after being set for security purposes. Reach out to Support to disable if necessary. Default to false |
force_dkim_authority | boolean If set to true, the domain will be the DKIM authority for itself even if the root domain is registered on the same mailgun account. If set to false, the domain will have the same DKIM authority as the root domain registered on the same mailgun account. Default to false. |
force_root_dkim_host | boolean If set to true, the root domain will be the DKIM Host for the domain being created even if the root domain itself is not registered with Mailgun. The domain being created will still need to pass domain verification with valid spf records for the domain and valid DKIM record for the root domain. This does not effect the smtp mail-from host for the domain being created. The mail-from host will remain the domain name being created, not the root domain. |
wildcard | boolean Determines whether the domain will accept email for sub-domains when sending messages. Default to false. |
pool_id | string Requested IP Pool to be assigned to the domain at creation. |
ips | string An optional, comma-separated list of IP addresses to be assigned to this domain.If not specified, all dedicated IP addresses on the account will be assigned.If the request cannot be fulfilled (e.g. a requested IP is not assigned to the account, etc), a 400 will be returned. |
spam_action | string Disabled, block or tag. Default to disabled. If disabled, no spam filtering will occur for inbound messages. If block, inbound spam messages will not be delivered. If tag, inbound messages will be tagged with a spam header. See Spam Filter. |
smtp_password | string Password for SMTP authentication |
use_automatic_sender_security | boolean Enable Automatic Sender Security. This requires setting DNS CNAME entries for DKIM keys instead of a TXT record. Defaults to false. |
web_prefix | string Sets your open, click and unsubscribe URLs domain name prefix. Links rewritten or added by Mailgun in your emails will look like |
web_scheme | string Sets your open, click and unsubscribe URLs to use http or https. Value either |
A 200 response
A 401 response
{- "message": "Domain DNS records have been created",
- "domain": {
- "created_at": "Thu, 13 Oct 2011 18:02:00 GMT",
- "id": "123456789012345678901234",
- "name": "example.com",
- "require_tls": true,
- "spam_action": "disabled",
- "state": "active",
- "type": "sandbox",
- "use_automatic_sender_security": true,
- "web_prefix": "email",
- "web_scheme": "http"
}, - "receiving_dns_records": [
- {
- "cached": [ ],
- "name": "example.com",
- "priority": "10",
- "record_type": "MX",
- "valid": "unknown"
}
], - "sending_dns_records": [
- {
- "cached": [
- "mxa.example.com",
- "mxb.example.com"
], - "name": "example.com",
- "priority": "10",
- "record_type": "A",
- "valid": "valid",
- "value": "1.2.3.4"
}
]
}
Fetches json representation of a domain that includes details about the domain's state and settings.
A 200 response
required | null or github.com-mailgun-domains-client-golang-Domain (object) Domain details |
Array of null or github.com-mailgun-domains-client-golang-Record (object) List of DNS records required for receiving emails | |
Array of null or github.com-mailgun-domains-client-golang-Record (object) List of DNS records required for sending emails |
A 401 response
A 404 response
{- "domain": {
- "created_at": "Thu, 13 Oct 2011 18:02:00 GMT",
- "id": "123456789012345678901234",
- "name": "example.com",
- "require_tls": true,
- "spam_action": "disabled",
- "state": "active",
- "type": "sandbox",
- "use_automatic_sender_security": true,
- "web_prefix": "email",
- "web_scheme": "http"
}
}
Update domains configuration like smtp credentials, enable/disable automatic sender security, spam actions, wildcard, or tracking web scheme.
A 200 response
A 401 response
A 404 response
{- "domain": {
- "created_at": "Thu, 13 Oct 2011 18:02:00 GMT",
- "id": "123456789012345678901234",
- "name": "example.com",
- "require_tls": true,
- "spam_action": "disabled",
- "state": "active",
- "type": "sandbox",
- "use_automatic_sender_security": true,
- "web_prefix": "email",
- "web_scheme": "http"
}, - "receiving_dns_records": [
- {
- "cached": [ ],
- "name": "example.com",
- "priority": "10",
- "record_type": "MX",
- "valid": "unknown"
}
], - "sending_dns_records": [
- {
- "cached": [
- "mxa.example.com",
- "mxb.example.com"
], - "name": "example.com",
- "priority": "10",
- "record_type": "A",
- "valid": "valid",
- "value": "1.2.3.4"
}
]
}
Verify the domains DNS records (includes A, CNAME, SPF, DKIM and MX records) to ensure the domain is ready and able to send
A 200 response
A 401 response
A 404 response
A 429 response
{- "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,
- "spam_action": "disabled",
- "state": "unverified",
- "type": "sandbox",
- "use_automatic_sender_security": true,
- "web_prefix": "email",
- "web_scheme": "http",
- "disabled": {
- "code": "blacklisted",
- "note": "for debugging",
- "permanently": true,
- "reason": "bad customer"
}
}, - "sending_dns_records": [
- {
- "cached": [
- "mxa.example.com",
- "mxb.example.com"
], - "name": "example.com",
- "priority": "10",
- "record_type": "A",
- "valid": "valid",
- "value": "0.0.0.0"
}
], - "receiving_dns_records": [
- {
- "cached": [
- "mxa.example.com",
- "mxb.example.com"
], - "name": "example.com",
- "priority": "10",
- "record_type": "A",
- "valid": "valid",
- "value": "0.0.0.0"
}
]
}
The domain must not be disabled or used as an authority for an other domain. Sandbox domain can't be deleted.
{- "message": "Domain will be deleted in the background"
}
Deprecated: please use PUT /v4/domains/{name} instead.Set both incoming and outgoing message retrieval TTL. The max TTL depends on your plan
A 200 response
required | object Message queue response |
required | object Scheduled message queue response |
A 400 response
A 401 response
A 404 response
{- "message": "Domain message TTL settings updated."
}
Deprecated: please use PUT /v4/domains/{name} instead.Update the MAILFROM hostname used by default for emails sent using the domain.
{- "message": "success"
}
Deprecated: please use PUT /v4/domains/{name} instead.This updates the web prefix used for a domain's tracking features. 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.
{- "message": "Domain web prefix updated"
}