SendGrid source

Sync data from SendGrid to your warehouse destination via RudderStack.

SendGrid is an email delivery and marketing tool that lets you build and deliver personalized experiences through their API and marketing automation flows.

This document guides you in setting up SendGrid as a source in RudderStack. Once configured, RudderStack automatically ingests your SendGrid data and routes it to your specified data warehouse destination.

warning
All the Cloud Extract sources support sending data only to a data warehouse destination.

Getting started

To set up SendGrid as a source in RudderStack, follow these steps:

  1. Log into your RudderStack dashboard.
  2. Go to Sources > New source > Cloud Extract and select SendGrid from the list of sources.
  3. Assign a name to your source and click Next.

Connection settings

  1. Enter the following connection credentials to authenticate your SendGrid account with RudderStack:
SendGrid credentials
  • SendGrid API key: Enter your SendGrid API key by going to your SendGrid dashboard and navigating to Settings > API Keys.
  • Start time: Choose the start date from which you want RudderStack to ingest the SendGrid data. RudderStack will not replicate any data before this date.
info
For more information on the required permissions for the API key, refer to the FAQ section below.

Destination settings

The following settings specify how RudderStack sends the data ingested from SendGrid to the connected warehouse destination:

  • Table prefix: RudderStack uses this prefix to create a table in your data warehouse and loads all your SendGrid data into it.
warning
Note that RudderStack does not add special characters like - or _ to the prefix by default. Hence, you need to specify it while setting the prefix.
  • Schedule Settings: RudderStack gives you three options to ingest the data from SendGrid:
    • Basic: Runs the syncs at the specified time interval.
    • CRON: Runs the syncs based on the user-defined CRON expression.
    • Manual: You are required to run the syncs manually.
info
For more information on the schedule types, refer to the Common Settings guide.

Selecting the data to import

You can choose the SendGrid data you want to ingest by selecting the required resources:

Selecting the data to import

The below table mentions the syncs and API endpoints supported by these resources from SendGrid to your warehouse destination:

ResourceFull Refresh syncIncremental syncSendGrid API endpoint
blocksYesYes/suppression/blocks
bouncesYesYes/suppression/bounces
campaignsYesNo/marketing/campaigns
contactsYesNo/marketing/contacts
global_suppressionsYesYes/suppression/unsubscribes
invalid_emailsYesYes/suppression/invalid_emails
listsYesNo/marketing/lists
messagesYesYes/messages
segmentsYesNo/marketing/segments
single_sendsYesNo/marketing/stats/singlesends
spam_reportsYesYes/suppression/spam_reports
stats_automationsYesNo/marketing/stats/automations
suppression_group_membersYesNo/asm/suppressions
suppression_groupsYesNo/asm/groups
templatesYesNo/templates
info
For more information on the Full Refresh and Incremental sync modes, refer to the Common Settings guide.

Note the following restrictions for the campaigns, messages, and single_sends resources:

  • campaigns: SendGrid currently supports two kinds of marketing campaigns - legacy and new marketing campaigns. However, RudderStack only supports the new marketing campaigns.
warning
If your SendGrid account uses legacy marketing campaigns, you might get a 403 Forbidden error while ingesting data from this resource.
  • messages: To ingest data from this resource, you must have purchased access to the Email Activity Feed API. For more information, refer to the SendGrid API documentation.
  • single_sends: RudderStack uses the stats API instead of the marketing API to ingest the data from this resource.

SendGrid is now configured as a source. RudderStack will start ingesting data from SendGrid as per your specified schedule and frequency.

You can further connect this source to your data warehouse by clicking on Add Destination:

Adding a destination
success
Use the Use Existing Destination option if you have an already-configured data warehouse destination in RudderStack. To configure a data warehouse destination from scratch, select the Create New Destination button.

FAQ

How do I obtain the SendGrid API key?

To obtain the API key for configuring the SendGrid Cloud Extract source, follow these steps:

  1. Log into your SendGrid dashboard.
  2. Go to Settings > API keys.
  3. Click the Create API key option:
SendGrid API key
  1. Enter the name of the API key under the API Key Name field. In API Key Permissions, select Restricted Access.
SendGrid API key permissions
  1. Set the permissions as shown below:
SendGrid required permissions
  1. Finally, click Create & View. Use these credentials to configure the source.
SendGrid API details
warning
Copy the API key and store it securely. SendGrid will not display the API key again once you click Done.

How does RudderStack sync the SendGrid data?

Upon configuring the source, RudderStack first connects to your SendGrid instance and pulls all historical data. Subsequently, RudderStack syncs the SendGrid data based on your specified sync schedule and frequency.

Is it possible to have multiple Cloud Extract sources writing to the same schema?

Yes, it is.

RudderStack associates a table prefix for every Cloud Extract source writing to a warehouse schema. This way, multiple Cloud Extract sources can write to the same schema with different table prefixes.

How does RudderStack count the events for Cloud Extract sources?

RudderStack counts the number of records returned by the source APIs when queried during each sync. It considers each record as an event.

How does RudderStack set the table name for the data sent via Cloud Extract sources?

RudderStack sets the table name for the resource you are syncing to the warehouse by adding rudder_ to the Table prefix you set while configuring your Cloud Extract source in the dashboard.

Cloud Extract table prefix

For example, if you set test_ as the Table prefix in the dashboard, RudderStack sets the table name as test_rudder_<resource_name>, where <resource_name> is the name of the resource you are syncing (for example, contacts, messages, etc.).

warning
Note that RudderStack does not add the character _ to the prefix by default. Hence, you need to specify it while setting the prefix.

Questions? Contact us by email or on Slack