Skip to main content

SendGrid

SendGrid is a cloud-based email delivery platform that provides transactional and marketing email services, helping businesses reliably send, track, and analyze email communications at scale.

SendGrid icon

Power end-to-end data operations for your SendGrid API with Nexla. Our bi-directional SendGrid connector is purpose-built for SendGrid, making it simple to ingest data, sync it across systems, and deliver it anywhere — all with no coding required. Nexla turns API-sourced data into ready-to-use, reusable data products and makes it easy to send data to SendGrid or any other destination. With comprehensive monitoring, lineage tracking, and access controls, Nexla keeps your SendGrid workflows fast, secure, and fully governed.

Features

Type: API

SourceDestination

  • Seamless API Integration: Connect to any endpoint as source or destination without coding, with automatic data product creation
  • Visual Composition & Chaining: Build complex integrations using visual templates, chain API calls, and compose workflows with data validation and filtering
  • API Proxy: Expose curated slices of your data securely with a secure and customizable API proxy that validates and transforms data on the fly
  • Request optimization with intelligent batching, retry, and caching to minimize API calls and costs

Prerequisites

Before creating a SendGrid credential, you need to obtain your API key from your SendGrid account. SendGrid uses API key authentication for all API requests, with the API key sent in the Authorization header with the Bearer prefix.

To obtain your SendGrid API key, follow these steps:

  1. Sign in to your SendGrid account using your administrator credentials.

  2. Navigate to your account settings or API management section in the SendGrid interface.

  3. Look for the API Keys or API section in your account settings, or navigate to Settings > API Keys or Account > API Keys.

  4. If you don't have an API key yet, look for the option to generate or create your API key.

  5. Click Create API Key or Generate API Key to create a new API key.

  6. Configure your API key settings:

    • Enter a name for the API key (e.g., "Nexla Integration")
    • Select the API key permissions (Full Access, Restricted Access, or Billing Access)
    • Review and select the specific permissions or scopes for the key (if using Restricted Access)
  7. Click Create & View or Create to create the API key.

  8. Copy the API key immediately after it's generated, as it may not be accessible again after you navigate away from the page.

  9. Store the API key securely, as you will need it to configure your Nexla credential. The API key is sensitive information and should be kept confidential.

The API key is sent in the Authorization: Bearer {key} header for all API requests to the SendGrid API. The API key authenticates your requests and grants access to SendGrid resources based on your account permissions. If your API key is compromised, you should immediately revoke it in your SendGrid account settings and generate a new one. For detailed information about obtaining API keys, API authentication, and available endpoints, refer to the SendGrid API documentation.

Authenticate

Credentials required

FieldRequiredSecretDescription
SendGrid API KeyNoNoSendGrid API Key

Create a credential in Nexla

  1. To create a new SendGrid credential, after selecting the data source/destination type, click the Add Credential tile to open the Add New Credential overlay.

New Credential Overlay – SendGrid

SendGridCred.png
  1. Enter a name for the credential in the Credential Name field and a short, meaningful description in the Credential Description field.

  2. Enter your SendGrid API key in the SendGrid API Key field. This is the API key you obtained from your SendGrid account settings (Settings > API Keys or Account > API Keys). The API key is sent in the Authorization: Bearer {key} header for all API requests to the SendGrid API. The API key is sensitive information and must be kept confidential.

    Your SendGrid API key can be found in your SendGrid account settings under Settings > API Keys or Account > API Keys. The API key is sent in the Authorization: Bearer {key} header for all API requests to the SendGrid API.

    If your API key is compromised, you should immediately revoke it in your SendGrid account settings and generate a new one. The API key provides access to your SendGrid account data and should be treated as sensitive information. Keep your API key secure and do not share it publicly.

    For detailed information about obtaining API keys, API authentication, and available endpoints, see the SendGrid API documentation.

  3. Click the Save button at the bottom of the overlay. The newly added credential will now appear in a tile on the Authenticate screen during data source/destination creation.

Use as a data source

To create a new data flow, navigate to the Integrate section, and click the New Data Flow button. Select the SendGrid connector tile, then select the credential that will be used to connect to your SendGrid account, and click Next; or, create a new SendGrid credential for use in this flow.

Endpoint templates

Nexla provides pre-built templates that can be used to rapidly configure data sources to ingest data from common SendGrid endpoints. Each template is designed specifically for the corresponding SendGrid endpoint, making data source setup easy and efficient. Select the endpoint from which this source will fetch data from the Endpoint pulldown menu. Available endpoint templates are listed in the expandable boxes below.

Get User Profile

This endpoint template retrieves your SendGrid user profile information from your SendGrid account. Use this template when you need to retrieve information about your SendGrid account, including account details, user information, and other profile metadata.

  • This endpoint automatically retrieves your SendGrid user profile from your SendGrid account. No additional configuration is required beyond selecting this endpoint template.

This endpoint returns your SendGrid user profile information, including account details, user information, and other profile metadata. Use this endpoint to retrieve information about your SendGrid account.

For detailed information about user profiles, API response structures, and available profile data, see the SendGrid API documentation.

Get Daily Global Email Stats

This endpoint template retrieves all of your global email statistics since yesterday from your SendGrid account. Use this template when you need to retrieve daily email statistics, including delivery rates, open rates, click rates, and other email performance metrics.

  • This endpoint automatically retrieves your global email statistics since yesterday from your SendGrid account. The endpoint uses the {now-1} macro to calculate yesterday's date automatically.

This endpoint returns all of your global email statistics since yesterday from your SendGrid account, including delivery rates, open rates, click rates, and other email performance metrics. The endpoint automatically calculates yesterday's date using the {now-1} macro.

For detailed information about email statistics, API response structures, and available metrics, see the SendGrid API documentation.

Global Email Stats For Date Range

This endpoint template retrieves all of your global email statistics between a given date range from your SendGrid account. Parent accounts will see aggregated stats for their account and all subuser accounts. Subuser accounts will only see their own stats. Use this template when you need to retrieve email statistics for a specific date range.

  • Enter the start date in the Start Date field. This should be the start date for the date range in the format YYYY-MM-DD (e.g., 2024-01-01). The start date determines the beginning of the date range for which statistics will be retrieved.
  • Enter the end date in the End Date field. This should be the end date for the date range in the format YYYY-MM-DD (e.g., 2024-01-31). The end date determines the end of the date range for which statistics will be retrieved.

This endpoint returns all of your global email statistics between a given date range from your SendGrid account, including delivery rates, open rates, click rates, and other email performance metrics. Parent accounts will see aggregated stats for their account and all subuser accounts. Subuser accounts will only see their own stats.

For detailed information about email statistics, API response structures, date range queries, and available metrics, see the SendGrid API documentation.

Get Marketing Campaigns

This endpoint template retrieves all marketing campaigns with pagination support from your SendGrid account. Use this template when you need to retrieve information about marketing campaigns, including campaign IDs, names, and other campaign metadata.

  • Enter the page size in the Page Size field. This should be the number of campaigns to retrieve per page. The page size determines how many campaigns will be returned in each API request.

This endpoint returns all marketing campaigns from your SendGrid account, including campaign IDs, names, and other campaign metadata. The endpoint uses next token-based pagination with page_token to handle large datasets efficiently. Nexla will automatically fetch subsequent pages of data by following the next page token returned in the API response.

For detailed information about marketing campaigns, API response structures, pagination, and available campaign data, see the SendGrid API documentation.

Get Contacts

This endpoint template retrieves all contacts with custom fields from your SendGrid account. Use this template when you need to retrieve information about contacts, including contact IDs, email addresses, and other contact metadata.

  • Enter the page size in the Page Size field. This should be the number of contacts to retrieve per page. The page size determines how many contacts will be returned in each API request.

This endpoint returns all contacts from your SendGrid account, including contact IDs, email addresses, and other contact metadata. The endpoint uses next token-based pagination with page_token to handle large datasets efficiently. Nexla will automatically fetch subsequent pages of data by following the next page token returned in the API response.

For detailed information about contacts, API response structures, pagination, and available contact data, see the SendGrid API documentation.

Get Verified Senders

This endpoint template retrieves all verified sender identities from your SendGrid account. Use this template when you need to retrieve information about verified senders, including sender IDs, email addresses, and other sender metadata.

  • This endpoint automatically retrieves all verified sender identities from your SendGrid account. No additional configuration is required beyond selecting this endpoint template.

This endpoint returns all verified sender identities from your SendGrid account, including sender IDs, email addresses, and other sender metadata. Use this endpoint to discover which senders are verified in your SendGrid account.

For detailed information about verified senders, API response structures, and available sender data, see the SendGrid API documentation.

Once the selected endpoint template has been configured, click the Test button to the right of the endpoint selection menu to retrieve a sample of the data that will be fetched. Sample data will be displayed in the Endpoint Test Result panel on the right, allowing you to verify that the source is configured correctly before saving.

Manual configuration

SendGrid data sources can also be manually configured to ingest data from any valid SendGrid API endpoint, including endpoints not covered by the pre-built templates, chained API calls, or custom query parameters. Select the Advanced tab at the top of the configuration screen, and follow the instructions in Connect to Any API to configure the API method, endpoint URL, date/time and lookup macros, path to data, metadata, and request headers.

The SendGrid API typically uses the GET method for retrieving data. The API endpoint URL should include the API version (/v3/) and the resource type path, for example https://api.sendgrid.com/v3/user/profile or https://api.sendgrid.com/v3/stats.

For the Response Data Path, use $ to extract the entire response for single record endpoints, $[*] to extract all items from the response array, or $.result[*] to extract all items from the result array, depending on your endpoint. For pagination, SendGrid uses next token-based pagination on some endpoints, with the token parameter name page_token and the JSONPath expression to the next page token at $._metadata.next.

Once all of the relevant settings have been configured, click the Create button in the upper right corner of the screen to save and create the new SendGrid data source. Nexla will now begin ingesting data from the configured endpoint and will organize any data that it finds into one or more Nexsets.

Use as a destination

Click the + icon on the Nexset that will be sent to the SendGrid destination, and select the Send to Destination option from the menu. Select the SendGrid connector from the list of available destination connectors, then select the credential that will be used to connect to your SendGrid account, and click Next; or, create a new SendGrid credential for use in this flow.

Endpoint templates

Nexla provides pre-built templates that can be used to rapidly configure destinations to send data to common SendGrid endpoints. Select the endpoint to which data will be sent from the Endpoint pulldown menu. Then, click on the template in the list below to expand it, and follow the instructions to configure additional endpoint settings.

Mail Send

This endpoint template allows you to send email over the SendGrid v3 Web API using records from a Nexset. Use this template when you need to send transactional or marketing emails through SendGrid. Check out the API documentation link for required record schema.

  • This endpoint sends data as JSON in the request body to send emails through your SendGrid account. Each record from your Nexset will be sent as a separate API request to send an email. The request body should contain the email data in the format required by the SendGrid API.

This endpoint sends data as JSON in the request body to send emails through your SendGrid account. Each record from your Nexset will be sent as a separate API request to send an email. The request body should contain the email data in the format required by the SendGrid API, including recipient information, subject, content, and other email properties.

The email structure must match the SendGrid API's expected format. For detailed information about email sending, request body formats, required record schema, and available email properties, see the SendGrid API documentation.

Manual configuration

SendGrid destinations can also be manually configured to send data to any valid SendGrid API endpoint. Using manual configuration, you can also configure Nexla to automatically send the response received from the SendGrid API after each call to a new Nexla webhook data source. Select the Advanced tab at the top of the configuration screen, and follow the instructions in Connect to Any API to configure the API method, data format, endpoint URL, request headers, attribute exclusions, record batching, and response webhooks.

The SendGrid API typically uses the POST method for creating resources and sending emails, and expects JSON format for all requests. The API endpoint URL should include the API version (/v3/) and the resource type path, for example https://api.sendgrid.com/v3/mail/send.

The request body should contain the resource data formatted as JSON, with field names matching the SendGrid API's expected structure. The request body format is typically {message.json} to send the entire Nexset data as JSON, or you can construct a custom JSON structure with specific field mappings. SendGrid API uses specific structures for different endpoints (mail send, contacts, etc.). For detailed information about request body formats, available endpoints, and resource structures, see the SendGrid API documentation.

Save & activate

Once all endpoint settings have been configured, click the Done button in the upper right corner of the screen to save and create the destination. To send the data to the configured SendGrid endpoint, open the destination resource menu, and select Activate.

The Nexset data will not be sent to the SendGrid endpoint until the destination is activated. Destinations can be activated immediately or at a later time, providing full control over data movement.