The whitelist API provides the ability to whitelist specific addresses from being added to bounce list. You can whitelist 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 whitelisted. This API is very useful if you test against your private services and don’t want to constantly clean up bounce lists.
Import a CSV file containing a list of addresses and/or domains to add to the whitelist. The CSV file must be 25MB or under and must contain the following column headers: address, domain. For each row provide either an address or a domain, but not both - choose one, keep the other blank.
A 202 response
A 400 response
A 500 response
{- "message": "file uploaded successfully for processing. standby..."
}
Fetch a single whitelist record to check if a given address or domain is present.
{- "type": "domain",
- "value": "alice@example.com",
- "createdAt": "Tue, 07 Jan 2025 19:25:45 UTC",
- "reason": "why the record was created"
}
Paginate over all whitelist records for a domain.
A 200 response
required | Array of objects |
required | object |
A 400 response
{- "items": [
- {
- "type": "domain",
- "value": "alice@example.com",
- "createdAt": "Tue, 07 Jan 2025 19:25:45 UTC",
- "reason": "why the record was created"
}
], - "paging": {
- "previous": "<previous page url>",
- "first": "<first page url>",
- "next": "<next page url>",
- "last": "<last page url>"
}
}
Add an address or domain to the whitelist table
{- "message": "Address/Domain has been added to the whitelists table",
- "type": "domain",
- "value": "example.com"
}