> For the complete documentation index, see [llms.txt](https://documentation.crossengage.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://documentation.crossengage.io/data-and-engagement-platform/messages/integrations/channels/email/mailgun/set-up-mailgun-integration.md).

# Set up Mailgun Integration

Before you begin, you will need the following:‌

* Mailgun Account
* CrossEngage Account
* User data (including an email address)

### **Fetching Your Mailgun API Key** <a href="#fetching-your-mailgun-api-key" id="fetching-your-mailgun-api-key"></a>

A Mailgun API key allows CrossEngage to connect to your Mailgun account. There are two simple ways to fetch your Mailgun API keys. You can either locate the keys in `Account Settings` > `Security` or by following the consecutive steps:‌

* [*Log in*](https://app.mailgun.com/sessions/new) to your Mailgun account.
* Scroll down on the dashboard.
* On the right side of the page you will find a box labelled `API keys` where your Public and Private API keys are located.

<figure><img src="https://985110910-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0Hio8LJewN8lQY2Vlqy0%2Fuploads%2FZTxXgTb4g3sGMOTpwt6e%2FMailgun.png?alt=media&amp;token=2711527f-09b7-4cbe-863b-3dbb1a657010" alt=""><figcaption></figcaption></figure>

**Public Validation Key** - Suitable for use in client-side web applications, such as through the jQuery plugin.

**Private API Key** - Suitable for use in backend applications where there is not a risk of key exposure.‌

* Click on the eye icon to make the full API key of your choice visible. We encourage you to use the Private API Key.
* Copy the Private API key - it will be used later for the integration.

<figure><img src="https://985110910-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0Hio8LJewN8lQY2Vlqy0%2Fuploads%2F3McVwZHMZijjdPhIvfKJ%2FMailgun_API.png?alt=media&amp;token=5ba03eaf-f0ee-4917-8a11-1ce567a6d812" alt=""><figcaption></figcaption></figure>

### Configuring a Mailgun Integration in CrossEngage <a href="#setting-up-a-mailgun-integration-in-crossengage" id="setting-up-a-mailgun-integration-in-crossengage"></a>

* In the CrossEngage app, navigate to `Settings` > `Integrations.`
* Click the `Add new integration` button in the top right corner of the page.

<figure><img src="https://985110910-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0Hio8LJewN8lQY2Vlqy0%2Fuploads%2FAgS47R9XoM50Wg0ysO8G%2FIntegrations_new.png?alt=media&amp;token=f0b23923-4d5f-4b08-85d8-b97df995be9f" alt=""><figcaption></figcaption></figure>

* Search for Mailgun, then click `Set up`. An integration set-up form will open.

<figure><img src="https://985110910-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0Hio8LJewN8lQY2Vlqy0%2Fuploads%2Fy1LJr8hOOSVigEnHWQ2m%2FIntegrations_Mailgun.png?alt=media&amp;token=bf8cd55a-2700-467f-a145-c2cd346f46ab" alt=""><figcaption></figcaption></figure>

* Enter a clear, descriptive name for your integration in the "Account name" field.
* Paste the Private API key that you copied from your Mailgun account during the previous steps into the "Connection" field.
* Click `Connect`.
* Choose your Mailgun domain and click `Apply` to save your integration.

<figure><img src="https://985110910-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0Hio8LJewN8lQY2Vlqy0%2Fuploads%2FaeqQms1s77y5RAgkXK0E%2FMailgun_Form.png?alt=media&amp;token=79d658fd-924a-4ab8-8f7f-29ef2bd0dfeb" alt=""><figcaption></figcaption></figure>
