
Twilio Sendgrid Account Setup
- 99 installs
- 26 repo stars
- Updated July 29, 2026
- twilio/ai
Complete, production-ready SendGrid account initialization with API authentication, domain verification, and SDK setup across major languages.
About
Set up SendGrid accounts for email delivery independent of Twilio credentials. This skill covers generating SG.-prefixed API keys with appropriate scopes, configuring domain authentication via CNAME DNS records (DKIM/SPF/return path), and installing SDKs across Python, Node.js, Java, C#, Ruby, PHP, and Go. Covers Single Sender Verification for testing, SMTP relay configuration, and critical security practices around API key storage. Essential prerequisite before implementing SendGrid send or webhook skills.
- SendGrid uses separate SG.-prefixed API keys, not Twilio Account SID/Auth Token
- Domain authentication requires 3 CNAME DNS records for production deliverability
- Restricted Access API keys scope permissions to only Mail Send for production security
- SMTP relay alternative via smtp.sendgrid.net for frameworks with built-in SMTP support
- API key secret shown once at creation - must be stored immediately in secrets manager
Twilio Sendgrid Account Setup by the numbers
- 99 all-time installs (skills.sh)
- +4 installs in the week ending Jul 27, 2026 (Skillselion tracking)
- Ranked #2,988 of 4,347 Backend & APIs skills by installs in the Skillselion catalog
- Data as of Jul 30, 2026 (Skillselion catalog sync)
twilio-sendgrid-account-setup capabilities & compatibility
- Capabilities
- api key generation with granular scopes · domain authentication via dns cname records · smtp relay configuration · multi language sdk installation · api key rotation and revocation
- Works with
- aws · gcp · github
- Use cases
- api development · devops · security audit
npx skills add https://github.com/twilio/ai --skill twilio-sendgrid-account-setupAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 99 |
|---|---|
| repo stars | ★ 26 |
| Last updated | July 29, 2026 |
| Repository | twilio/ai ↗ |
What it does
Initialize SendGrid email delivery service with API keys, domain authentication, and SDK configuration for production sending.
Who is it for?
Backend engineers setting up email infrastructure, DevOps engineers configuring email delivery pipelines, developers integrating email into SaaS applications.
Skip if: Frontend-only development, Twilio SMS/Voice setup, Twilio Email API (separate product), teams without DNS access to domain.
When should I use this skill?
Before implementing SendGrid email send, webhooks, or template management. Required if migrating email infrastructure to SendGrid.
What you get
Developer has verified SendGrid account with authenticated sending domain, restricted API key in secrets manager, and SDK installed in target language.
- SendGrid account with verified API key
- Domain authentication complete with 3 CNAME records
- SDK installed in target language
By the numbers
- 3 CNAME DNS records required for domain authentication
- 1 API key secret shown once at creation
- 7 major SDKs supported (Python, Node, Java, C#, Ruby, PHP, Go)
Files
Overview
SendGrid is Twilio's email delivery engine but uses a completely separate authentication system — SendGrid API keys (starting with SG.) are not Twilio API keys. You cannot use Account SID/Auth Token for SendGrid, and no Twilio MCP tools wrap SendGrid.
---
Quickstart
1. Get your API key from SendGrid Console > Settings > API Keys 2. Set environment variable:
export SENDGRID_API_KEY=SG.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx3. Install SDK:
| Language | Install | Package |
|---|---|---|
| Python | pip install sendgrid | sendgrid |
| Node.js | npm install @sendgrid/mail | @sendgrid/mail (v8.x) |
| Java | Maven | com.sendgrid:sendgrid-java |
| C# | dotnet add package SendGrid | SendGrid |
| Ruby | gem install sendgrid-ruby | sendgrid-ruby |
| PHP | composer require sendgrid/sendgrid | sendgrid/sendgrid |
| Go | go get github.com/sendgrid/sendgrid-go | sendgrid-go |
4. Authenticate your sending domain (see below)
---
API Key Scopes
| Scope | Use for | Risk |
|---|---|---|
| Full Access | Development only | Can do everything — never deploy with this |
| Restricted Access | Production | Scope to only what your app needs (e.g., Mail Send only) |
| Billing Access | Account management | Separate from mail operations |
A "Mail Send" restricted key can send email but cannot read suppressions, manage templates, or access stats. If you get 403 Forbidden, check key permissions.
---
SMTP Relay (Alternative to API)
SendGrid also supports SMTP for sending. Useful for frameworks with built-in SMTP support (e.g., Laravel, Django, Rails).
| Setting | Value |
|---|---|
| Server | smtp.sendgrid.net |
| Port | 587 (TLS) or 465 (SSL) |
| Username | apikey (literal string, not your key name) |
| Password | Your SendGrid API key (SG.xxx) |
---
Domain Authentication (Required for Production)
Single Sender Verification is for testing only. Production requires domain authentication for deliverability.
Setup: SendGrid Console > Settings > Sender Authentication > Authenticate Your Domain
Create 3 CNAME DNS records: 1. s1._domainkey.yourdomain.com → s1.domainkey.u1234.wl.sendgrid.net (DKIM) 2. s2._domainkey.yourdomain.com → s2.domainkey.u1234.wl.sendgrid.net (DKIM) 3. em1234.yourdomain.com → u1234.wl.sendgrid.net (return path)
Verify via API: GET /v3/whitelabel/domains/{id}/validate
DMARC: After setting up DKIM and SPF via domain authentication, configure a DMARC DNS record (_dmarc.yourdomain.com) to instruct receiving servers how to handle authentication failures. Start with p=none for monitoring before enforcing.
Dedicated IP (Pro+ plans): Isolates your sending reputation. Requires an IP warming schedule — start with low volume and increase over 30 days.
---
SendGrid and Twilio
| Twilio product | How it uses SendGrid | Sends email? |
|---|---|---|
| SendGrid (this skill) | Direct email delivery via api.sendgrid.com | Yes |
| Twilio Email API | Direct email delivery via comms.twilio.com/v1/emails — uses Twilio creds, not SendGrid keys | Yes (separate product) |
| Verify | OTP via channel: 'email' | Delegates to SendGrid via Mailer config |
| Conversations | Tracks EMAIL as a channel type | No — logs/tracks only |
| Flex | Email channel for agents | Uses SendGrid for delivery |
Servers:
- Global:
https://api.sendgrid.com - EU regional:
https://api.eu.sendgrid.com
---
CANNOT
- Cannot use Twilio credentials for SendGrid — Separate API keys (
SG.-prefix), separate Console, separate billing. - Cannot access SendGrid via Twilio MCP tools — No MCP integration. Use SDK or direct REST.
- Single Sender Verification requires re-verification on address change — Changing the sender email requires a new verification. Use Domain Authentication for production.
- Domain Authentication requires DNS access — 3 CNAME records needed. If you can't modify DNS, you can't authenticate.
- Domain Authentication API returns stale entries —
GET /v3/whitelabel/domainsincludes old invalid entries. Filter byvalid: true. - API Key Secret shown only at creation — Cannot retrieve afterward. Store immediately.
Security: Your API key is shown only once at creation. Never display, log, or repeat a user's API key in responses. If a user shares their key in conversation, advise them to rotate it immediately. Store keys in a secrets manager (AWS Secrets Manager, HashiCorp Vault, etc.), not in code or environment files committed to version control.
---
Next Steps
- Send email:
twilio-sendgrid-email-send - Domain settings and templates:
twilio-sendgrid-email-settings - Delivery tracking:
twilio-sendgrid-webhooks - Docs: SendGrid API Reference
interface:
display_name: "SendGrid Account Setup"
short_description: "Set up a SendGrid account for email delivery. Covers API key creation, domain authentication (DKIM/SPF), Single Sender Verification, and SDK installation."
icon_small: "./assets/icon-small.png"
icon_large: "./assets/icon-large.png"
brand_color: "#EF223A"
default_prompt: "How do I set up a SendGrid account to start sending email?"
policy:
allow_implicit_invocation: true