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

# Mailgun API

> Send email from your own Mailgun domain, check delivery, and manage suppressions, lists, templates and domains

The common use is sending from your own domain: an agent emails a client's user through your Mailgun account, so the email comes from your address and not Neo's, then reads Mailgun's delivery events to confirm it arrived.

> [!NOTE]
>
> Automatically enabled when you configure Mailgun permissions in your agent workflow, or on a dashboard.

## What It Does

* Send an email from a verified domain: text, HTML or a stored template with its variables, with CC, BCC, Reply-To, tags, scheduled delivery and attachments
* Read delivery events and logs for a message, a recipient or a tag: accepted, delivered, failed, opened, clicked, unsubscribed, complained
* Read and remove bounces, unsubscribes and complaints one address at a time, and manage the allowlist
* Manage mailing lists and their members, and domain and account templates
* Read and change domains, DNS verification, tracking, DKIM keys, inbound routes, forwards, webhooks, SMTP logins, IPs, subaccounts, limits and alerts
* Read sending stats and analytics

## Permission Groups

| Group | Covers |
| - | - |
| Sending & Scheduled Messages | Sending messages and MIME messages, stored messages and resending them, the sending queue, and scheduled mail |
| Events, Logs, Stats & Tags | Delivery events, logs, metrics and stats, bounce classification, and tags |
| Bounces, Unsubscribes, Complaints & Allowlist | Each domain's bounces, unsubscribes, complaints and allowlist, one address at a time or imported |
| Mailing Lists | Mailing lists and their members |
| Templates | Domain and account templates and their versions |
| Domains, DNS, Tracking & DKIM | Sending domains, their DNS records and verification, click, open and unsubscribe tracking, DKIM keys and rotation, and HTTPS tracking certificates |
| Inbound Routes, Forwards & Webhooks | Inbound routes, forwards, and domain and account webhooks |
| SMTP Logins | A domain's SMTP logins, such as a scanner's or an app's |
| IPs & IP Pools | Dedicated IPs, IP pools, dynamic IP pools, IP warmup and the IPs each domain sends from |
| Account, Subaccounts, Limits & Alerts | Account settings, subaccounts, sending limits and alerts, threshold alerts, users, API key list, sandbox recipients and the API IP allowlist |

## Access Profiles

| Profile | What runs on its own | What asks a technician |
| - | - | - |
| **Read Only** | Every read | No write is allowed |
| **Helpdesk** | Every read | Every write in Sending & Scheduled Messages, Bounces, Unsubscribes, Complaints & Allowlist, and Mailing Lists; no write in the other groups is allowed |
| **IT Admin** | Every read, and suppressions, lists, templates and domains outside [Safety Controls](#safety-controls) | Sending email, changes to routes, forwards and webhooks, SMTP logins, IPs and the account, and the changes in [Safety Controls](#safety-controls) |
| **Full Automation** | Every read and write outside [Safety Controls](#safety-controls) | The changes in [Safety Controls](#safety-controls) |

## Safety Controls

| Control | Behavior |
| - | - |
| **Always asks** | Deleting a domain or a subaccount, disabling a subaccount; creating or changing a webhook, an inbound route, a forward, an alert's destination or an SMTP login; testing an alert webhook; regenerating a signing key; importing a DKIM private key; and any write that sends an SMTP password or a DKIM private key always ask a technician, whatever the profile |
| **Never sent** | Creating or deleting an API key, reading the webhook signing key, and any change to the API IP allowlist; clearing a whole bounce, unsubscribe, complaint or allowlist list, every template, every SMTP login of a domain or every dynamic IP pool at once; deleting every account webhook at once. Neo removes records one at a time, and a technician does the rest in Mailgun |
| **Credentials in answers** | Neo hides SMTP passwords, signing keys, the alerts' Slack token and API key secrets before the agent reads an answer, and refuses a write that sends a hidden value back |
| **One send** | Neo never resends an email after an error, because Mailgun may have sent it; the agent reads the delivery events first |


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