---
title: SendGrid connector reference
description: Reference information for the SendGrid connector, including supported tables and destination schemas.
canonical_url: https://docs.databricks.com/aws/en/ingestion/lakeflow-connect/sendgrid-reference
---

# SendGrid connector reference

> [!NOTE]
> **Beta**
>
> This feature is in [Beta](https://docs.databricks.com/aws/en/release-notes/release-types.md). To use it, a workspace admin must turn on **Lakeflow Connect for SendGrid** from the **Previews** page. See [Manage Databricks previews](https://docs.databricks.com/aws/en/admin/workspace-settings/manage-previews.md).

This page has reference information for the managed SendGrid connector, including supported source tables and destination table schemas.

## <a id="supported-tables" />Supported source tables

The SendGrid connector supports the following source tables, all under the `default` source schema:

| Source table                | Primary key                                     | Description                                                                                                                      | Sync mode         | Cursor field |
| --------------------------- | ----------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | ----------------- | ------------ |
| `subusers`                  | `id`                                            | The subusers under the parent SendGrid account, including each subuser's username, email, and disabled state.                    | Full refresh only |              |
| `recent_access_attempts`    | `subuser`, `ip`                                 | Recent IP access attempts for each subuser, retrieved on behalf of the subuser.                                                  | Full refresh only |              |
| `parent_access_attempts`    | `ip`                                            | Recent IP access attempts for the parent account itself.                                                                         | Full refresh only |              |
| `bounces`                   |                                                 | Email addresses on the bounce suppression list, with the bounce status and reason.                                               | Full refresh only |              |
| `spam_reports`              |                                                 | Email addresses on the spam report suppression list.                                                                             | Full refresh only |              |
| `global_suppressions`       |                                                 | Email addresses that have unsubscribed from all email.                                                                           | Full refresh only |              |
| `blocks`                    |                                                 | Email addresses on the block suppression list, with the block status and reason.                                                 | Full refresh only |              |
| `invalid_emails`            |                                                 | Email addresses on the invalid email suppression list, with the reason.                                                          | Full refresh only |              |
| `suppression_group_members` | `group_id`, `email`                             | Email addresses that are suppressed from an unsubscribe group, with the group they belong to.                                    | Full refresh only |              |
| `suppression_groups`        | `id`                                            | The unsubscribe (suppression) groups defined on the account.                                                                     | Full refresh only |              |
| `contacts`                  | `contact_id`                                    | Marketing contacts, including custom fields. The connector reads the complete contact list through the SendGrid contacts export. | Full refresh only |              |
| `lists`                     | `id`                                            | Marketing contact lists, with the number of contacts in each list.                                                               | Full refresh only |              |
| `singlesends`               | `id`                                            | Marketing Single Sends, including status, categories, and A/B test settings.                                                     | Full refresh only |              |
| `templates`                 | `id`                                            | Legacy and dynamic transactional email templates, with their versions.                                                           | Full refresh only |              |
| `singlesend_stats`          | `id`, `ab_phase`, `ab_variation`, `aggregation` | Engagement statistics for Single Sends, one row per Single Send, A/B phase, A/B variation, and aggregation.                      | Full refresh only |              |
| `automations_stats`         | `id`, `step_id`, `aggregation`                  | Engagement statistics for Automations, one row per Automation, step, and aggregation.                                            | Full refresh only |              |
| `segments`                  | `id`                                            | Marketing segments (Segmentation v2), with contact counts and query validation status.                                           | Full refresh only |              |

## <a id="connector-options" />Connector options

The SendGrid connector has no additional configuration options beyond the pipeline settings available for all managed connectors. See [Ingest data from SendGrid](https://docs.databricks.com/aws/en/ingestion/lakeflow-connect/sendgrid-pipeline.md).

## <a id="destination-table-schemas" />Destination table schemas

### <a id="subusers-schema" />`subusers`

**Primary key:** `id`
**Sync mode:** Full refresh only

| Field      | Data type |
| ---------- | --------- |
| `id`       | `BIGINT`  |
| `username` | `STRING`  |
| `email`    | `STRING`  |
| `disabled` | `BOOLEAN` |

### <a id="recent-access-attempts-schema" />`recent_access_attempts`

**Primary key:** `subuser`, `ip`
**Sync mode:** Full refresh only

| Field         | Data type |
| ------------- | --------- |
| `subuser`     | `STRING`  |
| `allowed`     | `BOOLEAN` |
| `auth_method` | `STRING`  |
| `first_at`    | `BIGINT`  |
| `last_at`     | `BIGINT`  |
| `ip`          | `STRING`  |
| `location`    | `STRING`  |

### <a id="parent-access-attempts-schema" />`parent_access_attempts`

**Primary key:** `ip`
**Sync mode:** Full refresh only

| Field         | Data type |
| ------------- | --------- |
| `allowed`     | `BOOLEAN` |
| `auth_method` | `STRING`  |
| `first_at`    | `BIGINT`  |
| `last_at`     | `BIGINT`  |
| `ip`          | `STRING`  |
| `location`    | `STRING`  |

### <a id="bounces-schema" />`bounces`

**Primary key:** None
**Sync mode:** Full refresh only

| Field     | Data type |
| --------- | --------- |
| `email`   | `STRING`  |
| `created` | `BIGINT`  |
| `status`  | `STRING`  |
| `reason`  | `STRING`  |

### <a id="spam-reports-schema" />`spam_reports`

**Primary key:** None
**Sync mode:** Full refresh only

| Field     | Data type |
| --------- | --------- |
| `email`   | `STRING`  |
| `created` | `BIGINT`  |
| `ip`      | `STRING`  |

### <a id="global-suppressions-schema" />`global_suppressions`

**Primary key:** None
**Sync mode:** Full refresh only

| Field     | Data type |
| --------- | --------- |
| `email`   | `STRING`  |
| `created` | `BIGINT`  |

### <a id="blocks-schema" />`blocks`

**Primary key:** None
**Sync mode:** Full refresh only

| Field     | Data type |
| --------- | --------- |
| `email`   | `STRING`  |
| `created` | `BIGINT`  |
| `status`  | `STRING`  |
| `reason`  | `STRING`  |

### <a id="invalid-emails-schema" />`invalid_emails`

**Primary key:** None
**Sync mode:** Full refresh only

| Field     | Data type |
| --------- | --------- |
| `email`   | `STRING`  |
| `created` | `BIGINT`  |
| `reason`  | `STRING`  |

### <a id="suppression-group-members-schema" />`suppression_group_members`

**Primary key:** `group_id`, `email`
**Sync mode:** Full refresh only

| Field        | Data type |
| ------------ | --------- |
| `email`      | `STRING`  |
| `group_id`   | `BIGINT`  |
| `group_name` | `STRING`  |
| `created_at` | `BIGINT`  |

### <a id="suppression-groups-schema" />`suppression_groups`

**Primary key:** `id`
**Sync mode:** Full refresh only

| Field          | Data type |
| -------------- | --------- |
| `id`           | `BIGINT`  |
| `name`         | `STRING`  |
| `description`  | `STRING`  |
| `is_default`   | `BOOLEAN` |
| `unsubscribes` | `BIGINT`  |

### <a id="contacts-schema" />`contacts`

**Primary key:** `contact_id`
**Sync mode:** Full refresh only

| Field                   | Data type       |
| ----------------------- | --------------- |
| `contact_id`            | `STRING`        |
| `email`                 | `STRING`        |
| `first_name`            | `STRING`        |
| `last_name`             | `STRING`        |
| `alternate_emails`      | `ARRAY<STRING>` |
| `address_line_1`        | `STRING`        |
| `address_line_2`        | `STRING`        |
| `city`                  | `STRING`        |
| `state_province_region` | `STRING`        |
| `postal_code`           | `STRING`        |
| `country`               | `STRING`        |
| `phone_number`          | `STRING`        |
| `phone_number_id`       | `STRING`        |
| `whatsapp`              | `STRING`        |
| `line`                  | `STRING`        |
| `facebook`              | `STRING`        |
| `unique_name`           | `STRING`        |
| `external_id`           | `STRING`        |
| `anonymous_id`          | `STRING`        |
| `custom_fields`         | `VARIANT`       |
| `created_at`            | `STRING`        |
| `updated_at`            | `STRING`        |

> [!NOTE]
>
> This table does not support SCD type 2 because it has VARIANT columns.

### <a id="lists-schema" />`lists`

**Primary key:** `id`
**Sync mode:** Full refresh only

| Field           | Data type              |
| --------------- | ---------------------- |
| `id`            | `STRING`               |
| `name`          | `STRING`               |
| `contact_count` | `BIGINT`               |
| `_metadata`     | `STRUCT<self: STRING>` |

### <a id="singlesends-schema" />`singlesends`

**Primary key:** `id`
**Sync mode:** Full refresh only

| Field        | Data type                                                                                                                                                                    |
| ------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `id`         | `STRING`                                                                                                                                                                     |
| `name`       | `STRING`                                                                                                                                                                     |
| `status`     | `STRING`                                                                                                                                                                     |
| `categories` | `ARRAY<STRING>`                                                                                                                                                              |
| `send_at`    | `STRING`                                                                                                                                                                     |
| `created_at` | `STRING`                                                                                                                                                                     |
| `updated_at` | `STRING`                                                                                                                                                                     |
| `is_abtest`  | `BOOLEAN`                                                                                                                                                                    |
| `abtest`     | `STRUCT<type: STRING, winner_criteria: STRING, test_percentage: BIGINT, duration: STRING, winning_template_id: STRING, winner_selected_at: STRING, expiration_date: STRING>` |

### <a id="templates-schema" />`templates`

**Primary key:** `id`
**Sync mode:** Full refresh only

| Field        | Data type                                                                                                                                                                                   |
| ------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `id`         | `STRING`                                                                                                                                                                                    |
| `name`       | `STRING`                                                                                                                                                                                    |
| `generation` | `STRING`                                                                                                                                                                                    |
| `updated_at` | `STRING`                                                                                                                                                                                    |
| `versions`   | `ARRAY<STRUCT<id: STRING, template_id: STRING, active: BIGINT, name: STRING, subject: STRING, updated_at: STRING, generate_plain_content: BOOLEAN, editor: STRING, thumbnail_url: STRING>>` |

### <a id="singlesend-stats-schema" />`singlesend_stats`

**Primary key:** `id`, `ab_phase`, `ab_variation`, `aggregation`
**Sync mode:** Full refresh only

| Field          | Data type                                                                                                                                                                                                                                                       |
| -------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `id`           | `STRING`                                                                                                                                                                                                                                                        |
| `ab_phase`     | `STRING`                                                                                                                                                                                                                                                        |
| `ab_variation` | `STRING`                                                                                                                                                                                                                                                        |
| `aggregation`  | `STRING`                                                                                                                                                                                                                                                        |
| `stats`        | `STRUCT<bounce_drops: BIGINT, bounces: BIGINT, clicks: BIGINT, delivered: BIGINT, invalid_emails: BIGINT, opens: BIGINT, requests: BIGINT, spam_report_drops: BIGINT, spam_reports: BIGINT, unique_clicks: BIGINT, unique_opens: BIGINT, unsubscribes: BIGINT>` |

### <a id="automations-stats-schema" />`automations_stats`

**Primary key:** `id`, `step_id`, `aggregation`
**Sync mode:** Full refresh only

| Field         | Data type                                                                                                                                                                                                                                                       |
| ------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `id`          | `STRING`                                                                                                                                                                                                                                                        |
| `aggregation` | `STRING`                                                                                                                                                                                                                                                        |
| `step_id`     | `STRING`                                                                                                                                                                                                                                                        |
| `stats`       | `STRUCT<bounce_drops: BIGINT, bounces: BIGINT, clicks: BIGINT, delivered: BIGINT, invalid_emails: BIGINT, opens: BIGINT, requests: BIGINT, spam_report_drops: BIGINT, spam_reports: BIGINT, unique_clicks: BIGINT, unique_opens: BIGINT, unsubscribes: BIGINT>` |

### <a id="segments-schema" />`segments`

**Primary key:** `id`
**Sync mode:** Full refresh only

| Field                | Data type                                                 |
| -------------------- | --------------------------------------------------------- |
| `id`                 | `STRING`                                                  |
| `name`               | `STRING`                                                  |
| `query_version`      | `STRING`                                                  |
| `contacts_count`     | `BIGINT`                                                  |
| `parent_list_ids`    | `ARRAY<STRING>`                                           |
| `sample_updated_at`  | `STRING`                                                  |
| `next_sample_update` | `STRING`                                                  |
| `created_at`         | `STRING`                                                  |
| `updated_at`         | `STRING`                                                  |
| `status`             | `STRUCT<query_validation: STRING, error_message: STRING>` |
