Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
twilio avatar

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)
At a glance

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-setup

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs99
repo stars26
Last updatedJuly 29, 2026
Repositorytwilio/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

SKILL.mdMarkdownGitHub ↗

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.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

3. Install SDK:

LanguageInstallPackage
Pythonpip install sendgridsendgrid
Node.jsnpm install @sendgrid/mail@sendgrid/mail (v8.x)
JavaMavencom.sendgrid:sendgrid-java
C#dotnet add package SendGridSendGrid
Rubygem install sendgrid-rubysendgrid-ruby
PHPcomposer require sendgrid/sendgridsendgrid/sendgrid
Gogo get github.com/sendgrid/sendgrid-gosendgrid-go

4. Authenticate your sending domain (see below)

---

API Key Scopes

ScopeUse forRisk
Full AccessDevelopment onlyCan do everything — never deploy with this
Restricted AccessProductionScope to only what your app needs (e.g., Mail Send only)
Billing AccessAccount managementSeparate 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).

SettingValue
Serversmtp.sendgrid.net
Port587 (TLS) or 465 (SSL)
Usernameapikey (literal string, not your key name)
PasswordYour 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.coms1.domainkey.u1234.wl.sendgrid.net (DKIM) 2. s2._domainkey.yourdomain.coms2.domainkey.u1234.wl.sendgrid.net (DKIM) 3. em1234.yourdomain.comu1234.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 productHow it uses SendGridSends email?
SendGrid (this skill)Direct email delivery via api.sendgrid.comYes
Twilio Email APIDirect email delivery via comms.twilio.com/v1/emails — uses Twilio creds, not SendGrid keysYes (separate product)
VerifyOTP via channel: 'email'Delegates to SendGrid via Mailer config
ConversationsTracks EMAIL as a channel typeNo — logs/tracks only
FlexEmail channel for agentsUses 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 entriesGET /v3/whitelabel/domains includes old invalid entries. Filter by valid: 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

Related skills

Backend & APIsbackendintegrations

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.