# Mailgun

Mailgun is a cloud-based email infrastructure service, that provides a platform for sending, receiving, and tracking emails using robust APIs and flexible email sending options.

***

## Authentication Methods

### API Key

This authentication method requires **1** parameter:

* Your API Key

#### Generating your API Key

1. Visit your Mailgun Dashboard.
2. Open up the menu dropdown on the top right corner.
3. Click on **API Security**.

<figure><img src="https://2119005510-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FedNbhp7XNeTdK7we4Ka5%2Fuploads%2Fgit-blob-22565995f771bf1af7123c9b8fe0f6a8da9c0a6d%2F1.png?alt=media" alt=""><figcaption></figcaption></figure>

4. In API Security, click on **Add New Key**.

<figure><img src="https://2119005510-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FedNbhp7XNeTdK7we4Ka5%2Fuploads%2Fgit-blob-f6e6e5ed3cd1ccb14aea6be1e85226eebe7aad2f%2F2.png?alt=media" alt=""><figcaption></figcaption></figure>

5. Give your new key a description and create the key.

<figure><img src="https://2119005510-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FedNbhp7XNeTdK7we4Ka5%2Fuploads%2Fgit-blob-b37cb42568538c5682a1ee087903ccb4d96945ff%2F3.png?alt=media" alt=""><figcaption></figcaption></figure>

6. Your API key is now generated. Use this key as the parameter for **API KEY** when creating a connection to Mailgun.\
   \&#xNAN;*Note: this token is only viewable once.*

<figure><img src="https://2119005510-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FedNbhp7XNeTdK7we4Ka5%2Fuploads%2Fgit-blob-1edd0f37905026451289524c12a67d5fafbb5dec%2F4.png?alt=media" alt=""><figcaption></figcaption></figure>

***

## Inbound Syncs

The following inbound syncs are supported:

* [Logs](https://documentation.mailgun.com/docs/mailgun/api-reference/openapi-final/tag/Logs/#tag/Logs/operation/POST-v1-analytics-logs) (Incremental, Full Refresh)

{% hint style="warning" %}
Event Logs have a limited retention window which varies based on the subscription level, but can be as short as 1 day.

This means that:

* Your initial sync will start from the earliest available event
* If your syncs don't run often enough to keep up, you may end up with missing data
* You should avoid marking streams for full refresh with the truncate option, as this may result in loss of historical data
  {% endhint %}

***

## Outbound syncs

There is currently no outbound sync support for this App, but please [let us know](https://omnata.com/contact-us) if you have a use case in mind.
