> ## Documentation Index
> Fetch the complete documentation index at: https://docs.webrouter.net/llms.txt
> Use this file to discover all available pages before exploring further.

# Mailgun

> Mailgun Validate: single email validation with result, risk, reasons, disposable and role flags, plus the status and summaries of bulk validation and list health preview jobs. Sending is not covered.

![](https://mintcdn.com/webrouter/JBFYvcRI1PVnd4YX/logo/data-apis/mailgun.webp?fit=max\&auto=format\&n=JBFYvcRI1PVnd4YX\&q=85\&s=ecd7d9ae90480c81f4d53c25ce0d99d1)

[Web Catalog · Verification](https://docs.webrouter.net/data-apis.md?category=verification)

Needs&#x20;

`MAILGUN_API_KEY`

Endpoints

5

Auth

HTTP Basic

[Vendor docs](https://documentation.mailgun.com/docs/validate/api-overview)

&#x20;·&#x20;

[Pricing](https://www.mailgun.com/pricing/)

## Setup

| Variable | | What it is |
| - | - | - |
| `MAILGUN_API_KEY` | required | A Mailgun API key (Mailgun dashboard > API Security). Sent as HTTP Basic auth with the username 'api'. |
| `MAILGUN_API_HOST` | optional | API host: api.mailgun.net (US) or api.eu.mailgun.net for an EU account. Default `api.mailgun.net`. One of `api.mailgun.net`, `api.eu.mailgun.net`. |

Put them in your environment or `.env`; [Data APIs](https://docs.webrouter.net/vendors.md) covers the other ways.

## Notes

* Only the Validate (address verification) API is in this entry; nothing here sends mail. Starting, promoting or cancelling bulk jobs and list health previews is left out.
* Validation is limited to a set number of active requests at a time; a 429 means wait and retry.

## Endpoints

GET

Validate one email

Result (deliverable, undeliverable, do\_not\_send, catch\_all, unknown), risk (low, medium, high, unknown), reason list, disposable and role flags, typo suggestion, root address and engagement data.

[Open](#mailgun-address-validate)

GET

List bulk validation jobs

Every bulk validation job on the account with status, quantity, records processed, counts by result, risk and engagement, and JSON/CSV download links.

[Open](#mailgun-bulk-list)

GET

Get a bulk validation job

One bulk job's status, quantity, records processed, counts by result, risk and engagement, and JSON/CSV download links once done.

[Open](#mailgun-bulk-get)

GET

List list health preview jobs

All list health previews started on the account, with status, quantity and summary.

[Open](#mailgun-preview-list)

GET

Get a list health preview job

One list health preview: status, quantity, validity and a summary estimated from a sample of the list.

[Open](#mailgun-preview-get)

### Validate one email

GET

`/v4/address/validate`

`mailgun.address.validate`

Result (deliverable, undeliverable, do\_not\_send, catch\_all, unknown), risk (low, medium, high, unknown), reason list, disposable and role flags, typo suggestion, root address and engagement data.

Input

<table>
  <thead>
    <tr>
      <th>
        Name
      </th>

      <th>
        Type
      </th>

      <th>
        In
      </th>

      <th>
        Notes
      </th>
    </tr>
  </thead>

  <tbody>
    <tr><td>`address` required</td><td>string</td><td>query</td><td>The email address to validate, at most 512 characters. Example `foo@mailgun.com`</td></tr>

    <tr>
      <td>
        `provider_lookup`
      </td>

      <td>
        boolean
      </td>

      <td>
        query
      </td>

      <td>
        Let Mailgun contact the mailbox provider when its own data is not enough (default true). With false, an address it knows nothing about returns unknown with reason no\_data.
      </td>
    </tr>
  </tbody>
</table>

[Vendor docs](https://documentation.mailgun.com/docs/validate/single-valid-ir) · Same job: [Anymail Finder](https://docs.webrouter.net/data-apis/anymailfinder.md#anymailfinder-email-verify), [BounceBan](https://docs.webrouter.net/data-apis/bounceban.md#bounceban-email-verify), [Bouncer](https://docs.webrouter.net/data-apis/bouncer.md#bouncer-email-verify), [ContactOut](https://docs.webrouter.net/data-apis/contactout.md#contactout-email-verify), [DeBounce](https://docs.webrouter.net/data-apis/debounce.md#debounce-email-validate), [EmailListVerify](https://docs.webrouter.net/data-apis/emaillistverify.md#emaillistverify-email-verify)

```python Python theme={null}
router.call_data_api("mailgun.address.validate", {'address': 'foo@mailgun.com'})
```

```text MCP theme={null}
call_data_api(endpoint="mailgun.address.validate", params={"address": "foo@mailgun.com"})
```

> [!NOTE]
>
> * reason is an array: empty for a clean deliverable result, else codes such as mailbox\_does\_not\_exist, no\_mx, catch\_all, accept\_all, mailbox\_is\_disposable\_address, high\_risk\_domain, immature\_domain, smtp\_timeout.

### List bulk validation jobs

GET

`/v4/address/validate/bulk`

`mailgun.bulk.list`

Every bulk validation job on the account with status, quantity, records processed, counts by result, risk and engagement, and JSON/CSV download links.

Input

<table>
  <thead>
    <tr>
      <th>
        Name
      </th>

      <th>
        Type
      </th>

      <th>
        In
      </th>

      <th>
        Notes
      </th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>
        `account_id`

        required
      </td>

      <td>
        string
      </td>

      <td>
        header
      </td>

      <td>
        Your Mailgun account ID.
      </td>
    </tr>
  </tbody>
</table>

[Vendor docs](https://documentation.mailgun.com/docs/validate/oas/openapi-validate-final) · Same job: [Bouncer](https://docs.webrouter.net/data-apis/bouncer.md#bouncer-batch-status)

### Get a bulk validation job

GET

`/v4/address/validate/bulk/{list_id}`

`mailgun.bulk.get`

One bulk job's status, quantity, records processed, counts by result, risk and engagement, and JSON/CSV download links once done.

Input

<table>
  <thead>
    <tr>
      <th>
        Name
      </th>

      <th>
        Type
      </th>

      <th>
        In
      </th>

      <th>
        Notes
      </th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>
        `list_id`

        required
      </td>

      <td>
        string
      </td>

      <td>
        path
      </td>

      <td>
        The list ID of the job.
      </td>
    </tr>

    <tr>
      <td>
        `account_id`

        required
      </td>

      <td>
        string
      </td>

      <td>
        header
      </td>

      <td>
        Your Mailgun account ID.
      </td>
    </tr>
  </tbody>
</table>

[Vendor docs](https://documentation.mailgun.com/docs/validate/oas/openapi-validate-final) · Same job: [Bouncer](https://docs.webrouter.net/data-apis/bouncer.md#bouncer-batch-status)

### List list health preview jobs

GET

`/v4/address/validate/preview`

`mailgun.preview.list`

All list health previews started on the account, with status, quantity and summary.

Input

No inputs.

[Vendor docs](https://documentation.mailgun.com/docs/validate/oas/openapi-validate-final/list-health-preview/get-v4-address-validate-preview) · Same job: [Bouncer](https://docs.webrouter.net/data-apis/bouncer.md#bouncer-batch-status)

```python Python theme={null}
router.call_data_api("mailgun.preview.list")
```

```text MCP theme={null}
call_data_api(endpoint="mailgun.preview.list")
```

### Get a list health preview job

GET

`/v4/address/validate/preview/{list_id}`

`mailgun.preview.get`

One list health preview: status, quantity, validity and a summary estimated from a sample of the list.

Input

<table>
  <thead>
    <tr>
      <th>
        Name
      </th>

      <th>
        Type
      </th>

      <th>
        In
      </th>

      <th>
        Notes
      </th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>
        `list_id`

        required
      </td>

      <td>
        string
      </td>

      <td>
        path
      </td>

      <td>
        The list health preview ID.
      </td>
    </tr>
  </tbody>
</table>

[Vendor docs](https://documentation.mailgun.com/docs/validate/oas/openapi-validate-final/list-health-preview/get-v4-address-validate-preview--list-id-) · Same job: [Bouncer](https://docs.webrouter.net/data-apis/bouncer.md#bouncer-batch-status)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.