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

# Mailgun

> Connect Mailgun to your Atako agents — 13 read and 2 write actions.

Let your agents send emails from your Mailgun domains, add mailing list members, and read delivery events, metrics, suppressions and templates.

## Connection

* **Authentication**: API key (Private API key).
* **Required settings**:
  * **Region** — api for a US account (api.mailgun.net), api.eu for a domain hosted in the EU (api.eu.mailgun.net).

<Note>
  Mailgun dashboard → Account Settings → API keys → Create key: name it and copy the private API key secret (shown only once). A domain sending key is not enough — the agent also reads domains, events and lists. Set the region to "api.eu" if your domains are hosted in the EU region.

  See [Mailgun's documentation](https://documentation.mailgun.com/docs/mailgun/user-manual/api-key-mgmt/rbac-mgmt).
</Note>

## Read actions (13)

| Action               | Description                                                                                                                                                                                                                                                                            |
| -------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `get_domain`         | Get one domain: state, settings and the DNS records (SPF, DKIM, MX, tracking CNAME) it needs.                                                                                                                                                                                          |
| `get_mailing_list`   | Get one mailing list: name, description, access level and member count.                                                                                                                                                                                                                |
| `get_stats`          | Query sending metrics (counts and rates: delivered, opened, clicked, bounced…) over a time range, optionally for one domain and broken down by dimensions such as time, tag or domain. Read-only query.                                                                                |
| `get_template`       | Get one stored template; with active "yes", also its active version content.                                                                                                                                                                                                           |
| `list_bounces`       | List bounced addresses of a domain (Mailgun no longer sends to them) with the bounce code and error.                                                                                                                                                                                   |
| `list_complaints`    | List addresses of a domain that marked a message as spam.                                                                                                                                                                                                                              |
| `list_domains`       | List the sending domains of the account with their state (active, unverified, disabled). Returns the domain names every other action takes as "domain".                                                                                                                                |
| `list_events`        | List delivery events of a domain (accepted, rejected, delivered, failed, opened, clicked, unsubscribed, complained, stored), newest first unless ascending is "yes". Filter by event type, recipient, tags or time range (epoch seconds). Follow paging.next in the response for more. |
| `list_list_members`  | List the members of a mailing list with their name, variables and subscription status.                                                                                                                                                                                                 |
| `list_mailing_lists` | List the mailing lists of the account with their address, name and member count.                                                                                                                                                                                                       |
| `list_tags`          | List the tags used on the account, or search tags by prefix, optionally with their metrics. Read-only query.                                                                                                                                                                           |
| `list_templates`     | List the stored templates of a domain. Their names are usable as template in send\_email.                                                                                                                                                                                              |
| `list_unsubscribes`  | List unsubscribed addresses of a domain with the tags they unsubscribed from.                                                                                                                                                                                                          |

## Write actions (2)

| Action            | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `add_list_member` | Add a member to a mailing list. list\_address: the list. address: member email address (required). name: display name. vars: object of custom variables. subscribed: default true. upsert: true updates the member if it already exists, otherwise a duplicate is an error.                                                                                                                                                                                                                                                                             |
| `send_email`      | Send an email from one of your Mailgun domains. domain: the sending domain. from: "Name \<sender\@domain>" or a bare address. to: array of recipient addresses (at least one). cc, bcc: arrays of addresses. subject: required unless the template sets it. Body: text and/or html, or template (a stored template name) with template\_variables (object). reply\_to: address for replies. tags: array of tag strings for analytics. test\_mode: true processes the message without delivering it. delivery\_time: RFC 2822 date to schedule the send. |

## Permissions

Every action above must be explicitly granted to an agent before it can be used. See [Permissions](/integrations/permissions) for the grant model and [Security](/integrations/security) for how credentials are protected.

***

*Last reviewed against the provider API: September 2026.*
