# 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="/files/iq7d76MkXckIqEUn2BYB" 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="/files/kJi0qgMmw0uImiEH6JkS" 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="/files/zfWLFaM1kVBGbSAJoguR" alt=""><figcaption></figcaption></figure>

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

<figure><img src="/files/loUepm2MF0c4yTFhKFI0" 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="/files/Bmdk3aLEY21fTJgFOLEB" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://documentation.crossengage.io/data-and-engagement-platform/messages/integrations/channels/email/mailgun/set-up-mailgun-integration.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
