Say goodbye to email fire drills by building and monitoring your email solution on a trusted foundation. Our Email API and purpose-built MTA send over 100B emails per month for businesses of all sizes. On our collaborative platform, your teams can work together to create email templates that send programmatically, analyze email performance, and troubleshoot diagnostically to identify delivery issues.

Getting your emails delivered is our #1 priority - we understand that lost emails are lost customers. Our email platform provides streamlined tools and recommendations to achieve optimal inbox placement. With infrastructure that automates queue handling and throttles threat detection, Twilio SendGrid enables your teams to focus on building innovative customer experiences by optimizing for deliverability, scalability, and security.

Use Cases

  • Deliver timely alerts and notifications - from password resets to purchase confirmations.
  • Create personalized promotions based on triggers and segmentation.
  • Optimize email marketing campaigns with automation and intelligence.
  • Connect with consumers at the perfect time to influence a purchase, improving customer loyalty and lead conversions.

Account Setup

Two Factor AuthenticationTwo-factor authentication (2FA) is required by Twilio SendGrid in order to protect senders from account takeovers. To enable 2FA, navigate to Settings > Two-Factor Authentication in the Twilio SendGrid App, and click Add Two-Factor Authentication. To learn more about setting up 2FA, please read the documentation.

API KeysAPI Keys are used by your application, mail client, or website to authenticate access to Twilio SendGrid services. Unlike a username and password, an API key can be scoped to provide access to the minimum services needed by your application, and you can revoke an API key at any time without needing to change your username and password. For these reasons, API keys are required when connecting to all of Twilio SendGrid’s services. To learn more about creating API keys, please visit the Twilio SendGrid Knowledge Center.

Getting Started After Deploying SendGrid

Integrate and deliver email in minutes with our RESTful APIs and SMTP, libraries to support your programming language, and detailed documentation. Twilio SendGrid’s Email API provides support in seven different programming languages, including C#, Go, Java, Node.js, PHP, Python, and Ruby.

Code Examples


curl --request POST
  --header 'Authorization: Bearer YOUR_API_KEY'
  --header 'Content-Type: application/json'
  --data '{"personalizations": [{"to": [{"email": "[email protected]"}]}],"from": {"email": "[email protected]"},"subject": "Hello, World!","content": [{"type": "text/plain", "value": "Heya!"}]}'


// using SendGrid's Node.js Library
const sendgrid = require("sendgrid")("SENDGRID_APIKEY");
const email = new sendgrid.Email();

email.addTo("[email protected]");
email.setFrom("[email protected]");
email.setSubject("Sending an email with SendGrid is Fun");
email.setHtml("and easy to do anywhere, even with Node.js");



# using SendGrid's Python Library
import sendgrid
import os
from sendgrid.helpers.mail import *
sg = sendgrid.SendGridAPIClient(api_key=os.environ.get('SENDGRID_API_KEY'))
from_email = Email('[email protected]')
to_email = To('[email protected]')
subject = 'Sending with SendGrid is Fun'
content = Content('text/plain', 'and easy to do anywhere, even with Python')
mail = Mail(from_email, to_email, subject, content)
response =


# using SendGrid's Ruby Library
require 'sendgrid-ruby'
include SendGrid

from = '[email protected]')
to = '[email protected]')
subject = 'Sending with SendGrid is Fun'
content = 'text/plain', value: 'and easy to do anywhere, even with Ruby')
mail =, subject, to, content)

response = sg.client.mail._('send').post(request_body: mail.to_json)
puts response.status_code
puts response.body
puts response.headers