# Linking SendGrid as a source - Docs

![](https://res.cloudinary.com/dmukukwp6/image/upload/texture_tan_9608fcca70)

![](https://res.cloudinary.com/dmukukwp6/image/upload/texture_tan_dark_a92b0e022d)

Let AI connect your sources for you

Skip the manual setup — run this in your project and the wizard auto-detects your databases and APIs and connects them to PostHog.

`npx @posthog/wizard warehouse`

[Learn more](/wizard.md)

![PostHog Wizard hedgehog](https://res.cloudinary.com/dmukukwp6/image/upload/wizard_3f8bb7a240.png)

**Alpha release**

This source is currently in **alpha**. The interface and available tables may change.

Enter your SendGrid API key to pull your SendGrid data into the PostHog data warehouse.

## Adding a data source

1.  Go to the [sources tab](https://app.posthog.com/data-management/sources) of the data pipeline section in PostHog.
2.  Click **\+ New source** and then click **Link** next to SendGrid.
3.  You need an API key from SendGrid. Create one in your [SendGrid account settings](https://app.sendgrid.com/settings/api_keys) under **Settings → API Keys**. Grant the following read access (Restricted Access) so the key can reach the data you want to sync:
    -   **Suppressions** — bounces, blocks, invalid emails, spam reports, global unsubscribes, unsubscribe groups
    -   **Marketing** — marketing lists
    -   **Template Engine** — templates
4.  Back in PostHog, paste the key in the `API key` field and click **Next**.
5.  Select the tables you want to sync, set the sync method and frequency, then click **Import**.

Once the syncs are complete, you can start using SendGrid data in PostHog.

## Available tables

| Table | Description | Sync method |
| --- | --- | --- |
| bounces | Suppressed addresses that hard or soft bounced | Incremental |
| blocks | Addresses blocked from receiving mail | Incremental |
| invalid_emails | Addresses rejected as invalid | Incremental |
| spam_reports | Recipients who marked your mail as spam | Incremental |
| global_unsubscribes | Globally unsubscribed addresses | Incremental |
| unsubscribe_groups | Unsubscribe (suppression) groups | Full refresh |
| marketing_lists | Marketing contact lists | Full refresh |
| templates | Email templates (legacy and dynamic) | Full refresh |

**Incremental** tables sync only new or updated records on each run. **Full refresh** tables reload all data on each sync.

## Configuration

| Option | Type | Required |
| --- | --- | --- |
| API key | password | Yes |

## Supported tables

| Table | Description | Sync method | Incremental field | Primary key |
| --- | --- | --- | --- | --- |
| bounces | Email addresses that bounced — the receiving server rejected the message. | Incremental, Full refresh | created | — |
| blocks | Email addresses blocked due to temporary delivery issues such as a full mailbox or server outage. | Incremental, Full refresh | created | — |
| invalid_emails | Email addresses that are invalid or malformed and cannot receive mail. | Incremental, Full refresh | created | — |
| spam_reports | Email addresses of recipients who marked your mail as spam. | Incremental, Full refresh | created | — |
| global_unsubscribes | Email addresses on the global unsubscribe list, suppressed from all future mail. | Incremental, Full refresh | created | — |
| unsubscribe_groups | Suppression (unsubscribe) groups used to let recipients opt out of specific categories of mail. | Full refresh | — | — |
| marketing_lists | Marketing contact lists used to segment recipients for campaigns. | Full refresh | — | — |
| templates | Email templates (legacy and dynamic) used to compose messages. | Full refresh | — | — |

### Community questions

Ask a question

### Was this page useful?

HelpfulCould be better