At a glance
- Availability: Experimental (how to enable).
- Auth: API key.
- Connection: The key comes from
SENDGRID_API_KEY. - Docs: https://www.twilio.com/docs/sendgrid/api-reference/how-to-use-the-sendgrid-v3-api/authentication
Credentials
Set these per environment. See Connect an integration.| Variable | Required | Description |
|---|---|---|
SENDGRID_API_KEY | Yes | SendGrid API key (starts with SG.) Docs. |
Setup
- Sign in to SendGrid: Go to https://app.sendgrid.com and sign in. A free tier account is sufficient for testing.
- Verify a sender: Under Settings → Sender Authentication, verify a single sender address or authenticate your domain. Mail Send rejects unverified ‘from’ addresses.
- Create an API key: Open Settings → API Keys (https://app.sendgrid.com/settings/api_keys) and create a key with Full Access, or Restricted Access including Mail Send, Marketing, Template Engine, and Stats.
- Set the environment variable: Add the key to your .env as SENDGRID_API_KEY=SG…
- Verify access: Run List Templates to confirm the key works, then send a test email to yourself.
- SendGrid authenticates with ‘Authorization: Bearer SG.xxx’
- Mail Send returns HTTP 202 with an empty body on success
- Upsert Contacts is asynchronous - changes can take a few minutes to appear in List Contacts
Tools
| Tool | Access | Description |
|---|---|---|
| Send Email | Write | Send an email via the SendGrid v3 Mail Send API |
| List Contacts | Read | List marketing contacts in the account |
| Search Contacts | Read | Search marketing contacts with an SGQL query (read-only search via POST) |
| Upsert Contacts | Write | Add or update marketing contacts (asynchronous; returns a job_id) |
| List Templates | Read | List transactional email templates |
| Get Email Stats | Read | Get global email statistics (delivered, opens, clicks, bounces) for a date range |
Example prompts
- Send an email via SendGrid with a subject, recipient, and HTML body.
- Show my SendGrid email stats for the last 30 days and summarize delivery, open, and bounce rates.