Skip to main content

Connect to SendGrid

SendGrid is an email delivery platform for sending transactional and marketing email. Connect SendGrid to Retool to build tools that send email, manage contacts and lists, and monitor email activity.

What you can do with SendGrid in Retool

After you create a SendGrid resource in Retool, you can:

  • Send email: Send transactional and marketing email, including messages built from dynamic templates.
  • Manage contacts: Create, update, and organize contacts and contact lists.
  • Track activity: Retrieve email activity, statistics, and suppressions such as bounces and spam reports.

Before you begin

To connect SendGrid to Retool, you need the following:

  • SendGrid API key: An API key from your SendGrid account with permissions for the operations you plan to perform.
  • Retool permissions: Edit all permissions for resources in your organization.

Create a SendGrid resource

Follow these steps to create a SendGrid resource in Retool.

1. Create a new resource

In your Retool organization, navigate to Resources in the main navigation and click Create newResource. Search for SendGrid and click the SendGrid tile to begin configuration.

2. Configure general settings

Specify a name and description for the resource that indicates which SendGrid account it connects to. The description provides more context to users and Assist about how to use the resource.

SendGrid resource configuration form.

Resource name and description

Choose a name and description that indicate which SendGrid account the resource connects to.

Example nameExample description
SendGridSendGrid account for sending transactional and marketing email.
SendGrid NotificationsSendGrid resource scoped to an API key used only for order and account notifications.

3. Configure authentication

SendGrid uses API key authentication. Provide a SendGrid API key to authenticate requests.

Access token

Provide a SendGrid API key. Create or manage keys from SendGrid's API keys settings.

Example
{{ retoolContext.environment.sendGridApiKey }}
Protect API credentials

Retool encrypts the Access Token field automatically. Avoid pasting API keys into query bodies or other places where they could be exposed; reference them through configuration variables if you need to use the same key value elsewhere.

4. Configure advanced options

Outbound region

If your organization uses outbound regions, select the region that should be used for requests to SendGrid. This controls which geographic region your requests originate from.

5. Test the connection

Click Test connection to verify Retool can connect to your SendGrid account. A successful test confirms the API key is valid and has the necessary permissions.

If the connection test fails, verify:

  • API key validity: The API key is correct and hasn't been revoked.
  • API key permissions: The API key has permissions for at least one operation, since SendGrid restricted access keys can otherwise return permission errors.

6. Save the resource

Click Create resource to save your SendGrid resource. The resource is now available to use in apps, workflows, and agent tools across your Retool organization.

Interact with SendGrid data

Once you've created a SendGrid resource, you can interact with SendGrid data using Retool.

Switch to the new app builder

Retool recommends using the new app builder so you can use natural language to build React-based apps using AI.

Best practices

Follow these best practices to maintain the security of your SendGrid resource.

  • Use HTTPS only: Always connect to APIs over HTTPS to encrypt data in transit and protect authentication credentials.
  • Apply least privilege: Use restricted access API keys scoped to only the permissions a given use case requires, rather than full access keys.
  • Rotate credentials regularly: Follow SendGrid's recommendations for API key rotation, and revoke unused keys.
  • Use resource environments: Organizations on an Enterprise plan can configure multiple resource environments to maintain separate API keys for production, staging, and development.