Email API

Create an exceptional email program with the Email API trusted by top brands to deliver at scale.

Looking  for a custom plan? Contact Sales

API - 01
API - 01



Get your emails to the inbox — where they belong

Take advantage of features like ISP monitoring, event webhooks, sender authentication, dedicated IP addresses, and expert services to ensure your emails reach customers.

API - 02
API - 02
  • noun_speed_1421934 (1)Created with Sketch.
    Proven email deliverability

    You can rely on our globally distributed, cloud-based architecture.

  • noun_trusted_2714581Created with Sketch.
    Purpose-built MTA

    Use the MTA trusted to deliver over 100 billion emails/mo for brands like Uber.

  • noun_Time_2055748Created with Sketch.
    Time-saving features

    Fast troubleshooting, secure account management, and intuitive UI for data analysis.

The Email API by developers, for developers

Integrate and deliver in minutes with our RESTful APIs and SMTP, libraries to support your programming language, and interactive documentation.

    curl --request POST \
    	--url \
    	--header "Authorization: Bearer $SENDGRID_API_KEY" \
    	--header 'Content-Type: application/json' \
    	--data '{"personalizations": [{"to": [{"email": ""}]}],"from": {"email": ""},"subject": "Sending with SendGrid is Fun","content": [{"type": "text/plain", "value": "and easy to do anywhere, even with cURL"}]}'
    // using Twilio SendGrid's v3 Node.js Library
    const sgMail = require('@sendgrid/mail');
    const msg = {
      to: '',
      from: '',
      subject: 'Sending with Twilio SendGrid is Fun',
      text: 'and easy to do anywhere, even with Node.js',
      html: '<strong>and easy to do anywhere, even with Node.js</strong>',
    # using SendGrid's Ruby Library
    require 'sendgrid-ruby'
    include SendGrid
    from = '')
    to = '')
    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
    # using SendGrid's Python Library
    import os
    from sendgrid import SendGridAPIClient
    from sendgrid.helpers.mail import Mail
    message = Mail(
        subject='Sending with Twilio SendGrid is Fun',
        html_content='<strong>and easy to do anywhere, even with Python</strong>')
        sg = SendGridAPIClient(os.environ.get('SENDGRID_API_KEY'))
        response = sg.send(message)
    except Exception as e:
    // using SendGrid's Go Library
    package main
    import (
    func main() {
    	from := mail.NewEmail("Example User", "")
    	subject := "Sending with SendGrid is Fun"
    	to := mail.NewEmail("Example User", "")
    	plainTextContent := "and easy to do anywhere, even with Go"
    	htmlContent := "<strong>and easy to do anywhere, even with Go</strong>"
    	message := mail.NewSingleEmail(from, subject, to, plainTextContent, htmlContent)
    	client := sendgrid.NewSendClient(os.Getenv("SENDGRID_API_KEY"))
    	response, err := client.Send(message)
    	if err != nil {
    	} else {
    require 'vendor/autoload.php'; // If you're using Composer (recommended)
    // Comment out the above line if not using Composer
    // require("/sendgrid-php.php");
    // If not using Composer, uncomment the above line and
    // download from the latest release here,
    // replacing  with the path to the sendgrid-php.php file,
    // which is included in the download:
    $email = new \SendGrid\Mail\Mail(); 
    $email->setFrom("", "Example User");
    $email->setSubject("Sending with SendGrid is Fun");
    $email->addTo("", "Example User");
    $email->addContent("text/plain", "and easy to do anywhere, even with PHP");
        "text/html", "<strong>and easy to do anywhere, even with PHP</strong>"
    $sendgrid = new \SendGrid(getenv('SENDGRID_API_KEY'));
    try {
        $response = $sendgrid->send($email);
        print $response->statusCode() . "\n";
        print $response->body() . "\n";
    } catch (Exception $e) {
        echo 'Caught exception: '. $e->getMessage() ."\n";
    // using SendGrid's Java Library
    import com.sendgrid.*;
    public class Example {
      public static void main(String[] args) throws IOException {
        Email from = new Email("");
        String subject = "Sending with SendGrid is Fun";
        Email to = new Email("");
        Content content = new Content("text/plain", "and easy to do anywhere, even with Java");
        Mail mail = new Mail(from, subject, to, content);
        SendGrid sg = new SendGrid(System.getenv("SENDGRID_API_KEY"));
        Request request = new Request();
        try {
          Response response = sg.api(request);
        } catch (IOException ex) {
          throw ex;
    // using SendGrid's C# Library
    using SendGrid;
    using SendGrid.Helpers.Mail;
    using System;
    using System.Threading.Tasks;
    namespace Example
        internal class Example
            private static void Main()
            static async Task Execute()
                var apiKey = Environment.GetEnvironmentVariable("NAME_OF_THE_ENVIRONMENT_VARIABLE_FOR_YOUR_SENDGRID_KEY");
                var client = new SendGridClient(apiKey);
                var from = new EmailAddress("", "Example User");
                var subject = "Sending with SendGrid is Fun";
                var to = new EmailAddress("", "Example User");
                var plainTextContent = "and easy to do anywhere, even with C#";
                var htmlContent = "<strong>and easy to do anywhere, even with C#</strong>";
                var msg = MailHelper.CreateSingleEmail(from, to, subject, plainTextContent, htmlContent);
                var response = await client.SendEmailAsync(msg);
    API - 03
    API - 03

    Lost emails are lost customers

    Reliable and fast email delivery.

    Achieve optimal inbox placement with streamlined tools and impactful recommendations to make your email program more effective.

    • SPF records, custom DKIM, feedback loops, and dedicated IP addresses

    • Consultation from delivery experts on M3AAWG, ESPC, DMA, and EEC

    • Partnerships with mailbox providers like Gmail, Microsoft and Verizon Media

    • Infrastructure includes automated queue handling and throttle threat detection

    Your teammates will thank you

    One email service for your whole team.

    Remove silos to reach shared goals. The email platform that empowers developers, marketers, and business leaders to collaborate seamlessly.

    • Create email templates in the UI, send programmatically

    • Configure account settings (permissions and segmentation)

    • Troubleshoot diagnostically to identify delivery issues

    • Performance visibility for teammates across functions

    API - 04
    API - 04

    Maintain peace of mind with a trusted partner

    Your email program is safeguarded.

    We take privacy and security seriously. We’re continuously strengthening our measures to keep your account secure and protect your brand reputation.

    • Control account access with Teammate Permissions, API keys, 2FA, and IP access management

    • Protect data with Event Webhook security, opportunistic and enforced TLS encryption

    • Comply with SOC 2 type II and GDPR

    • Partner with dedicated fraud and compliance teams to monitor email delivery 24/7

    • Secure the messages you send with authentication standards DMARC, DKIM

    • Single Sign-On (SSO) to securely and centrally manage account permissions


    Email solutions to maximize your sending

    Add these extras to your base plan to send your best.

    Icon 30 days
    Icon 30 days

    30 Days of Email Activity History

    Gain visibility with more data by searching additional history and API access.

    Icon dedicated IP
    Icon dedicated IP

    Additional Dedicated IP Address

    Distribute your email traffic across IP addresses to guard your sender reputation and improve deliverability.

    Image 1
    Image 1

    Twilio Products and APIs

    Extend your customer communications across SMS, WhatsApp, Video, and more.

    Icon personalized support @2x
    Icon personalized support @2x

    Personalized Support

    Get the highest level of support to keep your email program up and running and skip the queue when you have critical questions.


    Deliverability Services

    Deliverability is at the heart of most email issues. Have an expert review, analyze, and diagnose your email program and make recommendations.

    Twilio segment products @2x
    Twilio segment products @2x

    Twilio Segment products

    Personalize your email campaigns with real-time data from the leading Customer Data Platform.


    Email tools for smarter sending

    Dynamic Email Templates

    Email templates with HTML rendering and conditional formatting with testing previews—accessed by your email API calls.

    Email Validation API

    Get results in real time to catch address typos in-form, bounce fewer emails and improve your sending reputation.

    SMTP Service

    Send over our leading cloud-based SMTP service for a quick and easy integration via SMTP relay or our flexible API.

    Email Testing for Dynamic Templates

    Test for inbox rendering, link validity, and performance against spam filters.


    Trust that your emails get delivered and your data is safe.


    The email tools and expertise you need to optimize your inbox delivery rate.


    Send on a world-class platform that delivers more than 148 billion emails every month.


    Email experts can help you optimize your program, troubleshoot, and resolve issues.

    24/7 Support

    Our support teams can give you information and guidance when you need it most.

    Ready to start sending?

    Free to get started. Free to send.