Transactional email service
SendGrid logo

SendGrid API + MCP (2026): v3 REST, 7 SDKs, docs-only MCP

SendGrid’s modern surface is the v3 REST API at https://api.sendgrid.com/v3/, authenticated with an API key sent as a bearer token, plus a first-party SMTP relay using the same credential. Twilio maintains 7 official SDKs across roughly 30 resource groups. On MCP the answer is narrower than the noise suggests: Twilio ships an official server, but it only reads documentation.

At a glance

v3
Current REST API
JSON over HTTPS, bearer-token auth. v2 still answers but is legacy-only.

7
Officially maintained SDKs
Python, Node.js, PHP, Ruby, Java, C#/.NET, Go, all first-party.

Docs only
Official MCP status
Twilio’s MCP server searches SendGrid specs. It cannot send mail.

MCP integration in 2026

The MCP question splits in two: can an agent read the API schemas reliably, and can it execute against the account. SendGrid answers yes to the first and no to the second.

i

Official MCP server exists, but it is read-only

Twilio operates an official server at https://mcp.twilio.com/docs, in Public Beta as of the July 20, 2026 doc update. It indexes Twilio’s public API specs — SendGrid included — across 1,800+ endpoints and 30+ products, exposing exactly two read-only tools. It cannot execute SendGrid calls or send email.

Available MCP servers

Six servers are worth knowing. The two OFFICIAL entries come from Twilio and neither is a general-purpose SendGrid email tool. The rest wrap the v3 API and deserve the scrutiny you give any unsupported dependency holding a live key.

Why buyers should care

SendGrid scores well on authoring and poorly on operating. The docs server improves the odds an agent writes correct SendGrid code first time, because it retrieves real schemas instead of recalling a 2022 blog post. Putting an agent in the send path means handing an SG. key to a community server you do not control, paying an aggregator to hold it, or wrapping an official SDK in your own MCP server. The third is a day of work and usually right for production volume.

SendGrid API essentials

Everything modern lives under /v3/. There is one transactional send endpoint and a much larger Marketing Campaigns surface with different pagination and a different object model — treating them as one API is the commonest confusion.

Base URL (global)https://api.sendgrid.com/v3/
Base URL (EU residency)https://api.eu.sendgrid.com — required for EU subusers
Current versionv3 RECOMMENDED
Legacy versionWeb API v2, form-encoded at /api/mail.send.json
Response formatJSON. Mail Send returns 202 plus X-Message-Id
Auth headerAuthorization: Bearer SG.xxxx
Pagination (core v3)limit + offset; limit 1–1000, default 10
Pagination (Marketing)page_size (max 1000) + page_token, with _metadata
Subuser impersonationon-behalf-of: <subuser_username>
SMTP relaysmtp.sendgrid.net — see SMTP settings
Inbound routingMX on mx.sendgrid.net, priority 10

Two pagination models is a migration hazard. A helper that walks limit and offset returns the same first page forever against /v3/marketing/lists, which ignores offset and expects you to follow _metadata.next until it is absent. Write one pager that branches on _metadata. A third interface is easy to forget: the SMTP relay accepts an X-SMTPAPI header carrying JSON instructions — substitutions, categories, unsubscribe groups, scheduling.

Authentication methods

API key as bearer token

The primary method for every v3 endpoint. Create the key under Settings › API Keys and send it as Authorization: Bearer SG.xxxx. Keys are shown once at creation, and the same string doubles as the SMTP password — a leaked key is a full-send compromise unless you constrained it.

Scoped API keys

Keys can be restricted to specific permission scopes instead of Full Access. A transactional sender should carry Mail Send and nothing else — the difference between a leaked credential that can send spam and one that can also read your contact database. GET /v3/scopes returns the scopes on the calling key.

on-behalf-of and subusers

A parent-account key acts as one of its subusers by adding on-behalf-of: <subuser_username>. This is how multi-tenant platforms isolate reputation per client without minting a key per tenant. Subuser management is Pro tier and above.

SMTP AUTH

The relay authenticates with AUTH LOGIN over STARTTLS or implicit TLS. The username is the literal lowercase string apikey and the password is the full API key. Port and TLS detail lives on the SMTP settings tab.

OAuth 2.0 (outbound only)

OAuth 2.0 client credentials exists for the Event Webhook, where SendGrid is the client: it fetches a token from your Token URL and presents it when POSTing events. It is not an inbound auth method for the REST API.

Basic auth with account credentials is dead

Authenticating v3 with your account username and password is deprecated and no longer supported. Any tutorial or plugin still asking for a SendGrid login rather than an API key describes a dead path — if it works, it is hitting legacy v2. The same trap applies to SMTP: that username field takes apikey, never your email address.

Rate limits

LimitValueNotes
Mail Send throughput10,000 req/sPublished for POST /v3/mail/send
Recipients per message1,000Across every to, cc and bcc in all personalizations
Total message size30 MBIncluding base64-encoded attachments
Concurrent SMTP connections10,000From a single server to the relay
Messages per SMTP connection5,000Reconnect after this many on one session
Inbound Parse size30 MBSpam checking only runs under 2.5 MB
Email Activity query160 conditionsLimit 1–1000; needs the paid add-on
Event Webhook endpoints2 / 5Essentials / Pro and Premier
Other v3 endpointsNot publishedEnforced per endpoint but never numbered


SendGrid publishes no emails-per-hour cap anywhere. Throughput is bounded by your plan’s monthly volume, dedicated-IP warmup state, and per-endpoint limits that are enforced but unnumbered. Read the headers instead: every v3 response carries X-RateLimit-Limit, X-RateLimit-Remaining and X-RateLimit-Reset (a Unix timestamp). Back off as Remaining nears zero and sleep until Reset on an HTTP 429 rather than pinning a rate in config. Teams needing a contractual figure end up on Amazon SES, where the send rate is an explicit, raisable quota.

Official SDKs

Twilio maintains 7 first-party libraries under the sendgrid GitHub organisation. All wrap the same v3 surface; the mail helpers differ in ergonomics, not capability. Alongside them sit smtpapi header helpers and Event Webhook signature-verification helpers for the same languages.

LanguagePackageInstallRepo
Pythonsendgridpip install sendgridsendgrid-python
Node.js@sendgrid/mailnpm i @sendgrid/mailsendgrid-nodejs
PHPsendgrid/sendgridcomposer require sendgrid/sendgridsendgrid-php
Rubysendgrid-rubygem install sendgrid-rubysendgrid-ruby
Javacom.sendgrid:sendgrid-javaMaven or Gradle coordinatesendgrid-java
C# / .NETSendGriddotnet add package SendGridsendgrid-csharp
Gosendgrid-gogo get github.com/sendgrid/sendgrid-gosendgrid-go

Read the release cadence, not the star count

Twilio calls several of these repos community-driven: SendGrid leads them, but release tags lag commit activity. The Python library’s v6.12.5 tag dates to September 19, 2025 and the Go library’s v3.16.1 to May 29, 2025, with repo activity into June 2026. Fine for Mail Send; less fine when a new Marketing Campaigns field has no typed helper for months. When an SDK lags, use the raw HTTP client each library exposes.

Notable community SDKs

Most teams reach SendGrid through a framework bridge. Symfony ships an official transport, symfony/sendgrid-mailer, driven by a sendgrid:// DSN. Django users take Anymail, whose backend also handles inbound and tracking webhooks. On Drupal, the SendGrid Integration module sends through the Web API; on WordPress the dominant route is WP Mail SMTP’s SendGrid mailer, which routes wp_mail() through the API rather than SMTP.

Endpoints reference

The fifteen resources below carry the traffic in most integrations. Full schemas are in the official v3 API reference.

ResourceMethodsDescription
Mail Send
/v3/mail/send
POSTTransactional send. Returns 202 plus X-Message-Id.
Scheduled Sends
/v3/user/scheduled_sends
GET, POST, PATCH, DELETEPauses or cancels mail queued with send_at, by batch_id.
Email Activity
/v3/messages
GETFiltered delivery search. Requires the paid history add-on.
Marketing Contacts
/v3/marketing/contacts
GET, PUT, DELETEAsync upsert by email onto lists. Returns a job_id you poll.
Contact Search
/v3/marketing/contacts/search
POSTSQL-like segmentation query by field value or engagement.
Marketing Lists
/v3/marketing/lists
GET, POST, PATCH, DELETECRUD for contact lists, paginated by page_token.
Segments 2.0
/v3/marketing/segments/2.0
GET, POST, PATCH, DELETEDynamic segments over contact fields and engagement events.
Single Sends
/v3/marketing/singlesends
GET, POST, PATCH, DELETEOne-off marketing sends. Separate from /v3/mail/send.
Templates
/v3/templates
GET, POST, PATCH, DELETEHandlebars templates; versions under /versions.
Suppressions
/v3/suppression/bounces
GET, DELETEBounces, plus sibling blocks, spam reports and unsubscribes.
Unsubscribe Groups
/v3/asm/groups
GET, POST, PATCH, DELETEPer-stream opt-out groups and their suppressions.
Event Webhook
/v3/user/webhooks/event/settings/all
GET, POST, PATCH, DELETEEndpoints, event types, signing and OAuth settings.
Inbound Parse
/v3/user/webhooks/parse/settings
GET, POST, PATCH, DELETEHostname-to-URL mappings; /parse/stats returns volume.
Domain Authentication
/v3/whitelabel/domains
GET, POST, PATCH, DELETECreates and validates sending domains; returns DNS records.
Statistics
/v3/stats
GETAggregated stats by day, week or month, with geo variants.

Code examples

Verifying a key and its scopes

The cheapest auth check there is: it tells you not just whether the key is valid but what it may do — the real question when a send returns 403.

curl -sS -X GET "https://api.sendgrid.com/v3/scopes" \
  -H "Authorization: Bearer $SENDGRID_API_KEY"

# 200 OK -> { "scopes": [ "mail.send", ... ] }
# 401 means the key is wrong or revoked. A 200 whose scopes
# array lacks "mail.send" is why your send returns 403.

Sending with Python

# pip install sendgrid
import os
import sendgrid
from sendgrid.helpers.mail import Mail, Email, To, Content

sg = sendgrid.SendGridAPIClient(api_key=os.environ.get('SENDGRID_API_KEY'))

message = Mail(
    Email('sender@yourdomain.com'),
    To('recipient@example.com'),
    'Sending with SendGrid is Fun',
    Content('text/plain', 'and easy to do anywhere, even with Python')
)

response = sg.client.mail.send.post(request_body=message.get())
print(response.status_code)  # 202 Accepted
print(response.headers.get('X-Message-Id'))

Sending with Node.js

// npm install --save @sendgrid/mail
const sgMail = require('@sendgrid/mail');
sgMail.setApiKey(process.env.SENDGRID_API_KEY);

const msg = {
  to: 'recipient@example.com',
  from: 'sender@yourdomain.com', // verified sender or authenticated domain
  subject: 'Sending with Twilio SendGrid is Fun',
  text: 'and easy to do anywhere, even with Node.js',
};

(async () => {
  try {
    const [response] = await sgMail.send(msg);
    console.log(response.statusCode); // 202
  } catch (error) {
    if (error.response) console.error(error.response.body);
  }
})();

Common gotchas

The SMTP username is the literal string “apikey”

Not your account email, not the key ID. The relay authenticates with username apikey in lowercase and the full SG. key as the password, and that key needs at least Mail Send permission. If you base64-encode credentials by hand, do it locally with openssl and check no newline crept in. See SMTP settings.

The free plan is gone — it is a 60-day trial now

SendGrid announced on May 27, 2025 that the Free Email API and Free Marketing Campaigns plans were retiring over 60 days. Sending was then paused on free accounts, and accounts holding more than 100 contacts had them permanently deleted. What exists in 2026 is a trial of 100 emails per day for 60 days; paid tiers start at $19.95/month. If a free tier is a hard requirement, see Brevo or Amazon SES.

Email Activity is a paid add-on and GET /v3/messages fails without it

The Email Activity feed and its API only return extended history if you buy the Additional Email Activity History add-on, which extends retention to 30 days. Without it a debugging query against /v3/messages will not return what you expect, and reseller or very-high-volume accounts cannot use the feed at all. Treat the Event Webhook as your source of truth and store events yourself; Postmark bundles message history instead of charging for it.

EU data residency needs three things at once

Regional EU sending, launched April 23, 2024, is not a checkbox. You need an EU Data Resident subuser, a dedicated IP provisioned in the EU, and calls to https://api.eu.sendgrid.com. It is Pro tier or higher. Miss any one and you get an error stating the user “is not authorized to send mail based on their regional attribute”; EU subusers cannot send from global IPs.

Web API v2 still answers, and its recipient limit was cut to 1,000

The old v2 mail endpoint is why so much legacy SendGrid code keeps working untouched. But on July 9, 2025 its recipients-per-request limit dropped from 10,000 to 1,000, and batch jobs sending ten thousand recipients in one call broke overnight. New work should use POST /v3/mail/send, capped at 1,000 recipients under a 30 MB ceiling.

Deprecations and changelog

  • August 3, 2026 — The “Send to a coworker” action was removed from the domain authentication flow, citing low usage and the risk of DNS values being mangled in transit.
  • June 2, 2025 — Notice that from July 9, 2025, recipients per Web API v2 mail send request would drop from 10,000 to 1,000.
  • May 27, 2025 — Free Email API and Free Marketing Campaigns plans retired over a 60-day transition; accounts over 100 contacts lost them unless they upgraded.
  • April 23, 2024 — Regional Email Sending (EU) launched for Pro and above: EU subusers, EU dedicated IPs and the https://api.eu.sendgrid.com base URL.
  • May 3, 2023 — Event Webhook gained multiple endpoints per account, each subscribable to a different set of event types.

Track changes at the official Twilio changelog. There is no SendGrid-only feed, so filter by product.

Frequently asked questions

What is the SendGrid API base URL and how do I authenticate?

The global base URL is https://api.sendgrid.com/v3/, with an API key sent as a bearer token: Authorization: Bearer SG.xxxx. Create the key under Settings › API Keys and scope it to the minimum needed. EU data residency accounts call https://api.eu.sendgrid.com. Basic auth with account credentials is deprecated.

How do I send an email with the SendGrid API in Python or Node.js?

Install the official SDK (pip install sendgrid or npm install @sendgrid/mail), set your key from an environment variable, and call the mail send helper. Both wrap POST /v3/mail/send, which returns 202 Accepted with an empty body and an X-Message-Id header. A 202 means accepted, not delivered — the outcome arrives on the Event Webhook. See the code examples.

What is the difference between SendGrid API v2 and v3?

v3 is the current JSON REST API with bearer-token auth, the personalizations model, dynamic templates and the full Marketing Campaigns surface. v2 is a legacy form-encoded endpoint at /api/mail.send.json that still answers, which is why old integrations keep working. On July 9, 2025 its recipient limit was cut from 10,000 to 1,000. Use v3 for anything new.

How do I set up the Event Webhook and verify its signature?

Configure an HTTPS URL under Settings › Mail Settings › Event Webhook, or via /v3/user/webhooks/event/settings. SendGrid POSTs a JSON array of delivery events (processed, dropped, deferred, delivered, bounce), engagement events (open, click, spam report, unsubscribe) and account status changes. Every event carries sg_event_id — deduplicate on it — and sg_message_id. Enable the Signed Event Webhook: requests carry an ECDSA signature and timestamp, verified as SHA-256 over the timestamp plus the raw request bytes. Endpoints are plan-gated at 2 on Essentials, 5 on Pro and Premier.

How do I receive inbound email with SendGrid Inbound Parse?

Point an MX record for a dedicated subdomain such as parse.example.com at mx.sendgrid.net with priority 10, then map that hostname to a POST URL under Settings › Inbound Parse. SendGrid POSTs multipart/form-data containing headers, dkim, to, from, subject, text, html, sender_ip, envelope and attachment info. Turn on “POST the raw, full MIME message” if you handle attachments. Maximum inbound size is 30 MB and the hostname cannot be changed later.

Is there an official SendGrid MCP server?

Not one that sends email. Twilio operates an official server at https://mcp.twilio.com/docs, in Public Beta, which indexes Twilio and SendGrid API specs and exposes two read-only tools. It cannot execute SendGrid API calls. An alpha Twilio Labs server, @twilio-alpha/mcp, executes against Twilio’s core public API but does not document SendGrid email coverage. Everything that calls POST /v3/mail/send over MCP today is community-built, such as Garoth/sendgrid-mcp, or a commercial aggregator such as Zapier or Pipedream MCP.

Changelog (recent)

  • 2026-08-03 SendGrid removed the "Send to a coworker" action from the domain authentication flow, citing low usage and the risk of DNS values being mangled in transit.
  • 2025-06-02 Notice that from July 9, 2025 the recipients-per-request limit on Web API v2 mail send would drop from 10,000 to 1,000, aligning v2 with the v3 Mail Send endpoint.
  • 2025-05-27 Free Email API and Free Marketing Campaigns plans retired over a 60-day transition. Sending was paused on free accounts and accounts over 100 contacts had contacts permanently deleted unless upgraded.
AAlaa Touil RRabeb How we test →

This review follows our email infrastructure testing methodology. We disclose affiliate relationships in our editorial independence policy.