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

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

<figure><img src="/files/haH7z9og9YaFlngGahAH" alt=""><figcaption></figcaption></figure>

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

<figure><img src="/files/fc0xve8cIIWChtyUsuoZ" 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="/files/p6ABcMMTHk6b1ZtYDzsP" 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.


---

# 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://docs.omnata.com/omnata-product-documentation/omnata-sync-for-snowflake/apps/mailgun.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.
