SendGrid Core integration summary

Stitch’s SendGrid Core integration replicates data using the SendGrid v3 API. Refer to the Schema section for a list of objects available for replication.

SendGrid Core feature snapshot

A high-level look at Stitch's SendGrid Core (v1.0) integration, including release status, useful links, and the features supported in Stitch.

STITCH
Release Status Released Supported By

Stitch

Stitch Plan

Free

Singer GitHub Repository

SendGrid Core Repository

DATA SELECTION
Table Selection

Supported

Column Selection

Supported

REPLICATION SETTINGS
Anchor Scheduling

Supported

Advanced Scheduling

Unsupported

Table-level Reset

Unsupported

Configurable Replication Methods

Unsupported

TRANSPARENCY
Extraction Logs

Supported

Loading Reports

Supported

Connecting SendGrid Core

SendGrid Core setup requirements

To set up SendGrid Core in Stitch, you need:

  • Access to the objects you want to replicate from SendGrid. This is required to grant the required permissions to the API key Stitch uses to connect to your SendGrid account.

    For example: If you want to replicate campaign data, you need to be able to access campaigns in your SendGrid account.

Step 1: Create a SendGrid general API key for Stitch

Note: You can’t assign an API key greater permissions than you currently have in SendGrid.

  1. Sign into your SendGrid account.
  2. On the dashboard page, click Settings > API Keys.
  3. Click Create API Key.
  4. In the API Key Name field, enter a name for the key. For example: Stitch API key
  5. In the API Key Permissions section, select Restricted Access.
  6. In the Access Details section, enable the following:
    • Email Activity - Read Access
    • Marketing Campaigns - Full Access (Note: SendGrid doesn’t currently provide a read-only level for this object.)
    • Suppressions - Read Access
    • Template Engine - Read Access
    • Tracking - Read Access
  7. Click Create & View.
  8. The API key will display. Copy the key before closing the page, as SendGrid won’t display it again.

Step 2: Add SendGrid Core as a Stitch data source

  1. Sign into your Stitch account.
  2. On the Stitch Dashboard page, click the Add Integration button.

  3. Click the SendGrid Core icon.

  4. Enter a name for the integration. This is the name that will display on the Stitch Dashboard for the integration; it’ll also be used to create the schema in your destination.

    For example, the name “Stitch SendGrid Core” would create a schema called stitch_sendgrid_core in the destination. Note: Schema names cannot be changed after you save the integration.

  5. In the SendGrid API Key field, paste your SendGrid API key.

Step 3: Define the historical sync

The Sync Historical Data setting will define the starting date for your SendGrid Core integration. This means that:

  • For tables using Incremental Replication, data equal to or newer than this date will be replicated to your data warehouse.
  • For tables using Full Table Replication, all data - including records that are older, equal to, or newer than this date - will be replicated to your data warehouse.

Change this setting if you want to replicate data beyond SendGrid Core’s default setting of 1 year. For a detailed look at historical replication jobs, check out the Syncing Historical SaaS Data guide.

Step 4: Create a replication schedule

In the Replication Frequency section, you’ll create the integration’s replication schedule. An integration’s replication schedule determines how often Stitch runs a replication job, and the time that job begins.

SendGrid Core integrations support the following replication scheduling methods:

To keep your row usage low, consider setting the integration to replicate less frequently. See the Understanding and Reducing Your Row Usage guide for tips on reducing your usage.

Initial and historical replication jobs

After you finish setting up SendGrid Core, its Sync Status may show as Pending on either the Stitch Dashboard or in the Integration Details page.

For a new integration, a Pending status indicates that Stitch is in the process of scheduling the initial replication job for the integration. This may take some time to complete.

Free historical data loads

The first seven days of replication, beginning when data is first replicated, are free. Rows replicated from the new integration during this time won’t count towards your quota. Stitch offers this as a way of testing new integrations, measuring usage, and ensuring historical data volumes don’t quickly consume your quota.


SendGrid Core table schemas

Replication Method :

Key-based Incremental

Replication Key :

end_time

Primary Key :

email

API endpoint :

List all blocks

The blocks table contains info about the email addresses currently on your blocks list. There are several causes for blocked emails: A mail server IP address being on an ISP blacklist, blocked by an ISP, or if the receiving server flags the message content.

email
STRING

The email address of the blocked email entry.

Reference:

created
INTEGER

The Unix timestamp indicating when the email address was added to the blocks list.

reason
STRING

An explanation for the reason of the block.

status
STRING

The status of the block.


Replication Method :

Key-based Incremental

Replication Key :

end_time

Primary Key :

email

API endpoint :

List all bounces

The bounces table contains info about bounced emails. A bounced email is when the message is undeliverable and returned to the server that sent it.

email
STRING

The email address that bounced.

Reference:

created
INTEGER

The Unix timestamp of the time the bounce occurred.

reason
STRING

An explanation for the reason the email bounced.

status
STRING

The status of the bounce.


Replication Method :

Key-based Incremental

Replication Key :

timestamp

Primary Key :

id

API endpoint :

List all campaigns

The campaigns table contains info about all your campaigns.

id
INTEGER

The campaign ID.

title
STRING

The display title of the campaign in the SendGrid Marketing Campaigns UI.

subject
STRING

The subject of the campaign that recipients will see.

sender_id
INTEGER

The ID of the ‘sender’ identity. Recipients will see this as the “From” on your marketing emails.

list_ids
ARRAY

The IDs of the lists the campaign is being sent to.

value
INTEGER

The list ID.

Reference:

campaigns (table), list_ids (attribute)

segment_ids
ARRAY

The segment IDs the campaign is being sent to.

value
INTEGER

The segment ID.

Reference:

campaigns (table), segment_ids (attribute)

categories
ARRAY

The categories associated with the campaigns.

value
STRING

The name of the category.

campaigns (table), categories (attribute)

suppression_group_id
INTEGER

The ID of the suppression group that the marketing email belongs to, allowing recipients to opt-out of emails of this type.

Reference:

custom_unsubscribe_url
STRING

The URL of the custom unsubscribe page provided for customers to unsubscribe from suppression groups.

ip_pool
STRING

The pool of IPs that the email should be sent from.

html_content
STRING

The HTML content of the marketing email.

plain_content
STRING

The plain text content of the marketing email.

status
STRING

The status of the campaign. For example: Draft


Replication Method :

Key-based Incremental

Replication Key :

timestamp

Primary Key :

id

API endpoint :

List recipients

The contacts table contains info about the contacts in your SendGrid account.

Contact custom fields

Stitch’s SendGrid Core integration will replicate any custom fields associated with contact records.

id
STRING

The contact ID.

created_at
INTEGER

The Unix timestamp of the time the contact was created.

updated_at
INTEGER

The Unix timestamp of the last time the contact was updated.

email
STRING

The email address associated with the contact.

Reference:

last_emailed
INTEGER

The Unix timestamp of the last time the contact was emailed.

last_clicked
INTEGER

The Unix timestamp of the last time the contact clicked on an email.

last_opened
INTEGER

The Unix timestamp of the last time the contact opened an email.

first_name
STRING

The first name of the contact.

last_name
STRING

The last name of the contact.

custom_fields
ARRAY

The custom fields associated with the contact.

[field_name]
VARIES

The custom field associated with the contact, where [field_name] is the name of the field in SendGrid.

The data type of this field will vary and depends on the type in SendGrid. For example: If this is a text field in SendGrid the field will be a STRING.

contacts (table), custom_fields (attribute)

global_suppressions

Replication Method :

Key-based Incremental

Replication Key :

end_time

Primary Key :

email

API endpoint :

List all globally unsubscribed email addresses

The global_suppressions table contains info about global suppressions, or global unsubscribes. Recipients who are globally suppressed will be removed from any email you send.

email
STRING

The email address of the recipient who is globally suppressesd.

Reference:

created
INTEGER

The Unix timestamp of the time the recipient was added to the global suppression list.


Replication Method :

Full Table

Primary Key :

id

API endpoint :

List all suppression groups

The groups_all table contains info about the groups in your SendGrid account. Groups are specific types of email you want your recipients to be able to unsubscribe from or subscribe to. For example: Newsletters, Invoices, Alerts, etc.

id
INTEGER

The ID of the suppression group.

Reference:

name
STRING

The name of the suppression group.

description
STRING

A description of the suppression group.

last_email_sent_at
INTEGER

The Unix timestamp of when the suppression group was last emailed.

is_default
BOOLEAN

If true, the suppression group is the default suppression group.

unsubscribes
INTEGER

The number of unsubscribes associated with the group.


Replication Method :

Full Table

Primary Key :

email

API endpoint :

List all suppressions

The group_members table contains a list of email and group_id pairs, allowing you to identify recipients and the groups they are members of.

email
STRING

The email address of the recipient.

Reference:

group_id
INTEGER

The ID of the group the recipient is a member of.

Reference:


Replication Method :

Key-based Incremental

Replication Key :

end_time

Primary Key :

email

API endpoint :

List all invalid emails

The invalids table contains info about invalid email addresses. An invalid email occurs when you attempt to send an email to an address that is formatted in a manner that doesn’t meet internet email format standards, or the email doesn’t exist at the recipient’s email server.

For example: Email addresses that don’t include the @ symbol.

email
STRING

The email address marked as invalid.

Reference:

created
INTEGER

The Unix timestamp of when the email address was added to the invalid emails list.

reason
STRING

The reason the email address was marked as invalid. For example: Mail domain mentioned in email address is unknown


Replication Method :

Full Table

Primary Key :

id

API endpoint :

List all lists

The lists_all table contains info about your recipient lists.

id
INTEGER

The list ID.

Reference:

name
STRING

The name of the list.

recipient_count
INTEGER

The current number of recipients currently in the list.


Replication Method :

Full Table

Primary Key :

id

API endpoint :

List all list recipients

The lists_members table contains info about members of your lists.

List member custom fields

Stitch’s SendGrid Core integration will replicate any custom fields associated with list member records.

id
STRING

The ID of the list member.

created_at
INTEGER

The Unix timestamp of the time the list member was added to the list.

updated_at
INTEGER

The Unix timestamp of the last time the list member was updated.

email
STRING

The email address of the list member.

Reference:

list_id
INTEGER

The ID of the list the member belongs to.

Reference:

last_emailed
INTEGER

The Unix timestamp of the last time the list member was emailed by one of your campaigns.

last_clicked
INTEGER

The Unix timestamp of the last time the list member clicked a link from one of your campaigns.

last_opened
INTEGER

The Unix timestamp of the last time the list member last opened an email from one of your campaigns.

first_name
STRING

The first name of the list member.

last_name
STRING

The last name of the list member.

custom_fields
ARRAY

The custom fields associated with the list member.

[field_name]
VARIES

The custom field associated with the list member, where [field_name] is the name of the field in SendGrid.

The data type of this field will vary and depends on the type in SendGrid. For example: If this is a text field in SendGrid the field will be a STRING.

lists_members (table), custom_fields (attribute)

Replication Method :

Full Table

Primary Key :

id

API endpoint :

List all segments

The segments_all table contains info about the segments in your SendGrid account, and the conditions required for recipients to be added to the segment.

For example: A segment for recipients with email addresses that contain @stitchdata.com

id
INTEGER

The segment ID.

Reference:

name
STRING

The name of the segment.

recipient_count
INTEGER

The current number of recipients in the segment.

conditions
ARRAY

Details about the conditions a recipient must meet to be included in the segment.

For example: To be included on a segment for Stitch, email addresses must contain @stitchdata.com. The condition could be:

  • field: email
  • operator: contains
  • value: @stitchdata.com

field
STRING

The name of the field used in the condition. For example: email

value
STRING

The value associated with the field in field. For example: @stitchdata.com

operator
STRING

The operator used in the condition. Possible values are:

  • eq (Equal to)
  • ne (Not equal to)
  • lt (Less than)
  • gt (Greater than)
  • contains

and_or
STRING

If applicable, the and or or operation associated with the condition.

segments_all (table), conditions (attribute)

Replication Method :

Full Table

Primary Key :

id

API endpoint :

List recipients on a segment

The segments_members table contains info about the members of your segments.

Segment member custom fields

Stitch’s SendGrid Core integration will replicate any custom fields associated with segment member records.

id
STRING

The ID of the segment member.

created_at
INTEGER

The Unix timestamp of the time the segment member was added to the segment.

updated_at
INTEGER

The Unix timestamp of the last time the segment member was updated.

email
STRING

The email address of the segment member.

Reference:

segment_id
INTEGER

The ID of the segment the member belongs to.

Reference:

last_emailed
INTEGER

The Unix timestamp of the last time the segment member was emailed by one of your campaigns.

last_clicked
INTEGER

The Unix timestamp of the last time the segment member clicked a link from one of your campaigns.

last_opened
INTEGER

The Unix timestamp of the last time the segment member last opened an email from one of your campaigns.

first_name
STRING

The first name of the segment member.

last_name
STRING

The last name of the segment member.

custom_fields
ARRAY

The custom fields associated with the segment member.

[field_name]
VARIES

The custom field associated with the segment member, where [field_name] is the name of the field in SendGrid.

The data type of this field will vary and depends on the type in SendGrid. For example: If this is a text field in SendGrid the field will be a STRING.

segments_members (table), custom_fields (attribute)

Replication Method :

Key-based Incremental

Replication Key :

end_time

Primary Key :

email

API endpoint :

List all spam reports

The spam_reports table contains info about spam reports made against your messages. Spam reports occur when a recipient indicates they think your message is spam, which their email provider then reports to SendGrid.

email
STRING

The email address of the recipient who marked the message as spam.

Reference:

created
INTEGER

The Unix timestamp of the time the spam report was made.

status
STRING

The status of the spam report.


Replication Method :

Full Table

Primary Key :

id

API endpoint :

List all templates

The templates_all table contains info about the transactional templates in your SendGrid account. Transactional templates are templates specifically created for transactional email and are different than Marketing Campaign templates.

id
STRING

The template ID.

name
STRING

The name of the template.

versions
ARRAY

Details about each version of the template, if the template is versioned.

template_id
STRING

The ID of the original template.

active
INTEGER

Indicates if the template version is the active version associated with the template.

name
STRING

The name of the template version.

html_content
STRING

The HTML content of the template version.

plain_content
STRING

The plain text content of the template version.

subject
STRING

The subject of the template version.

editor
STRING

The editor used in the SendGrid UI. Possible values are code or design.

templates_all (table), versions (attribute)


Questions? Feedback?

Did this article help? If you have questions or feedback, feel free to submit a pull request with your suggestions, open an issue on GitHub, or reach out to us.