> ## 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.

# Connecting Mailgun to Neo

> Make a Mailgun API key and save it in Neo

You connect Mailgun once at the MSP level, with one API key for your Mailgun account.

## Before you start

Neo sends from a domain you have already added and verified in Mailgun. In Mailgun, open **Send > Sending > Domains** and check that the domain you want Neo to send from shows as **Active**. A sandbox domain sends only to the recipients you authorized in Mailgun.

## 1. Make the API key

In Mailgun, open **Settings > API Security** and add a new API key. Give it a description such as "Neo" and the **Admin** or **Developer** role, so Neo can send and read delivery events; a **Basic** key can read only. Copy the key when Mailgun shows it. A domain sending key does not work, because it cannot read your domains or delivery events.

## 2. Add the key in Neo

**1. Open Integrations**

In the Neo Dashboard, open **Integrations** and find the Mailgun card, under Chat & Alerting.

**2. Enter the details**

* **API Key**: the key from step 1.
* **Region**: **United States**, or **Europe** when you sign in at `app.eu.mailgun.com`.

**3. Save**

Click **Save settings**. Neo checks the key against Mailgun before saving, so a wrong key or the wrong region is rejected straight away.

If you turned on the API IP allowlist in Mailgun, add Neo's addresses to it first ([IP Whitelisting](https://docs.neoagent.io/integrations/ip-whitelisting.md)), or Mailgun refuses Neo's calls.

## 3. Turn Mailgun on per agent

Open the agent, go to the Integrations section, and pick an access profile for the Mailgun block, or set each area yourself:

| Area | Access levels you can pick | Notes |
| - | - | - |
| **Sending & Scheduled Messages** | Disabled, Read Only, Read / Write | Send email. Read / Write for an agent that sends. |
| **Events, Logs, Stats & Tags** | Disabled, Read Only, Read / Write | Delivery events and logs. Read Only lets the agent check delivery. |
| **Bounces, Unsubscribes, Complaints & Allowlist** | Disabled, Read Only, Read / Write | Why an address is blocked, and removing it. |
| **Mailing Lists** | Disabled, Read Only, Read / Write | Lists and their members. |
| **Templates** | Disabled, Read Only, Read / Write | The templates Neo fills when it sends. |
| **Domains, DNS, Tracking & DKIM** | Disabled, Read Only, Read / Write | Domains, DNS records, tracking settings and DKIM keys. |
| **Inbound Routes, Forwards & Webhooks** | Disabled, Read Only, Read / Write | Where inbound mail and delivery events go. |
| **SMTP Logins** | Disabled, Read Only, Read / Write | A domain's SMTP logins, such as a scanner's. |
| **IPs & IP Pools** | Disabled, Read Only, Read / Write | Dedicated IPs and pools. |
| **Account, Subaccounts, Limits & Alerts** | Disabled, Read Only, Read / Write | Subaccounts, sending limits, alerts and users. |

**Helpdesk** and **IT Admin** ask a technician before each email, because an agent that reads tickets can be steered by a ticket's text to email what it read to anyone. To send with no approval, pick **Full Automation**, or turn approval off on **Sending & Scheduled Messages**, and say in the agent's instructions whom it may email. See [Mailgun API](https://docs.neoagent.io/agents/tools/communication/mailgun-api.md) for the profiles and what the agent can read and change.


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