> AI agents: this is one page from Mammoth Analytics documentation. The index of all pages as Markdown is https://mammoth.io/docs/llms.txt. Append `.md` to any docs URL, or send `Accept: text/markdown`, to get Markdown.

# Connect SendGrid to Mammoth with an API key

> Connect Mammoth to SendGrid with a restricted API key, pick email delivery tables and columns, and save them as a dataset that refreshes daily.

The SendGrid connector imports email delivery data from your SendGrid account into Mammoth as a dataset. It signs in with a SendGrid API key, with no OAuth step. Open it from **Data Library** > **New dataset** > **Connectors** and search for **SendGrid**. Project Admins create the connection; Project Editors can start datasets from a connection the project already has. Which connectors you can add depends on your plan.

## What you can bring in from SendGrid

- The email delivery tables the API key can read, and the columns you tick.
- Data you ask for in the **Chat**, for example *"which table has invoice due dates?"*

The dataset can refresh daily or only when you ask.

## Before you connect SendGrid

You need:

- A SendGrid account.
- A SendGrid **API key** with read access to the data you want to import.
- If your SendGrid account restricts API access by IP, Mammoth's IP address on the allowed list. See [Allow Mammoth through your firewall](https://mammoth.io/docs/learn/get-data-in/network-requirements/).

### Create a restricted SendGrid API key

1. In SendGrid, go to **Settings → API Keys**.
2. Click **Create API Key**.
3. Give it a name, for example `Mammoth Integration`.
4. Under **API Key Permissions**, select **Restricted Access**.
5. Grant read access to the data you want to import.
6. Click **Create & View** and copy the API key. It won't be shown again.

## Connect SendGrid to Mammoth

These steps follow the shared flow in [Connect a database or app](https://mammoth.io/docs/learn/get-data-in/connect-a-source/).

1. Go to the **Data Library** and click **New dataset**.
2. Choose **Connectors**.
3. Search for **SendGrid** and click its tile. The connector workspace opens with the **Chat** showing.
4. In the **Chat**, Mammoth shows a card that asks for the connection details. Fill in the fields below.
5. Click **Connect**. Mammoth checks the API key and saves the connection. If the check fails, the card shows the error.

![SendGrid New Connection form with API Secret and Name fields and a notice to whitelist Mammoth's IP address](https://mammoth.io/docs/images/20260826_114343_SendGrid_connection.webp)



| Field | What to enter |
| --- | --- |
| **API Secret** | Your SendGrid restricted API key (the form labels this field "API Secret") |
| **Name** | A label for this connection (required) |

A note on the card shows Mammoth's IP address and reminds you to whitelist it if your SendGrid account restricts API access by IP.

## Pick SendGrid tables and columns

1. In **Tables**, click a table to see its columns and sample rows.
2. Tick the columns you want. They gather in **Your table**.
3. Click **Preview 100 rows** to check the result.

![SendGrid New Dataset dialog with the Alerts table selected, a SELECT query, data preview, and Save as dataset button](https://mammoth.io/docs/images/20260826_114423_Sendgrid_table_selected.webp)



## Save SendGrid data as a dataset

1. Click **Save as dataset**.
2. Enter a **Dataset name** and choose a folder under **Save in**.
3. Choose **Daily** to refresh the dataset every day, or **Manual** to refresh it only when you ask.
4. Click **Save**. When the dataset is ready, click **Open dataset**.

## Refresh SendGrid data and choose an update method

Choosing **Daily** creates a [Dataset Refresh](https://mammoth.io/docs/learn/automate/refresh-a-dataset/) automation for the dataset. To run it on another schedule, edit that automation. For a dataset saved with **Manual**, create a Dataset Refresh automation yourself.

After you save, the dataset's **Update method** setting offers these options:

| Update method | What it does |
| --- | --- |
| **Replace all data** | Rebuilds the dataset from the source on every refresh |
| **Add new rows only** | Keeps your rows and adds rows above the last value of a **Key column** |
| **Keep only the newest rows** | Empties the dataset, then brings in rows since the last refresh (needs a **Key column**) |

A key column is a numeric or date column whose values only go up, such as an ID or a date.

## Allow Mammoth's IP address in SendGrid

If your SendGrid account restricts API access by IP, add Mammoth's IP address, shown on the connection card, to the allowed list.

## Troubleshoot SendGrid authentication

| Symptom | Likely cause | Fix |
| --- | --- | --- |
| `Entered api key is not valid, Please enter the valid api key` | SendGrid rejected the key | Copy the whole key again; keys are long strings |
| Data you expect is missing | The key's permissions don't cover it | Check the API key permissions include read access to that data |
| Connection is refused | IP access management blocks Mammoth | Add Mammoth's IP address to SendGrid's allowed list |

## Related

- [Connect a database or app](https://mammoth.io/docs/learn/get-data-in/connect-a-source/): the shared connector workspace steps.
- [Allow Mammoth through your firewall](https://mammoth.io/docs/learn/get-data-in/network-requirements/): the IP address to allow.
- [Manage saved connections](https://mammoth.io/docs/learn/get-data-in/connections/): edit the connection when you rotate the key.
- [Refresh a dataset](https://mammoth.io/docs/learn/automate/refresh-a-dataset/): change when the dataset refreshes.
- [Mailchimp](https://mammoth.io/docs/learn/get-data-in/connectors/mailchimp/): import audience and campaign data.

---
Source: https://mammoth.io/docs/learn/get-data-in/connectors/sendgrid.md · Updated: 2026-11-08
