Yes, SendGrid has an API. Its Web REST API v3 lives at api.sendgrid.com/v3/, authenticated with an API key in an Authorization Bearer header, and the Mail Send endpoint at POST /v3/mail/send sends email. Official libraries cover seven languages, and a message's total size mustn't exceed 20MB.
It does, and it's the main way developers send email through SendGrid. You'll find it well documented. If you've inherited an older integration, though, read the authentication section first: one change trips up a lot of old scripts.
What every request needs
- The host: always api.sendgrid.com/v3/. SendGrid recommends not pointing at its IP addresses, because they occasionally change without notice.
- An Authorization header with an API key, sent as Authorization: Bearer followed by the key.
- JSON bodies for anything submitted by POST or PUT.
To start sending, you need a SendGrid account, an API key, and either cURL or one of the official libraries: PHP, Python, Node.js, Java, C#, Go and Ruby.
Inside a Mail Send request
| Part | What SendGrid says |
|---|---|
| Endpoint | POST /v3/mail/send over the v3 Web API |
| personalizations | Required array, up to 1000 items |
| from | Should be a verified sender in your SendGrid account |
| to | Each object needs an email address, with an optional name |
| Total size | No more than 20MB, including the message, headers and all attachments |
Set up Sender Authentication before you send anything real. If you don't, SendGrid warns that your first test email may land in spam, which is an unhelpful way to start.
Before your first real send
A few things are worth having in place before you point live traffic at the API, and they all come from SendGrid's own guidance. Add a verified sender, because the from address should be one. Set up Sender Authentication, so your first messages don't land in spam. Create an API key scoped to what your code needs. Then pick the official library for your language, or use cURL if you're just checking the request shape. Once a message to your own inbox arrives cleanly, you're ready to wire it into your app.
Scoping API keys
SendGrid's API keys can have specific permissions, limiting which areas of the account each key can reach. Use that. It's a small job that pays off. A key that only needs to send mail shouldn't be able to change account settings, and if it's ever exposed, a tightly scoped key limits the damage.
Basic Authentication is gone
Twilio SendGrid Docs are clear on the condition that catches people. SendGrid no longer accepts Basic Authentication, so old scripts that log in with a username and password must be moved to an API key. And a message over 20MB in total, attachments included, is refused, so large files need to be linked rather than attached.
The workaround for old integrations
- Create an API key with only the permissions the script needs.
- Replace the username and password in the script with an Authorization: Bearer header carrying the key.
- Make sure request bodies are JSON and point at api.sendgrid.com/v3/, not an IP address.
- Send a single message to yourself, confirm it arrives in the inbox rather than spam, then switch the live traffic over.
EU sending and compressed bodies
EU regional subusers use the base URL api.eu.sendgrid.com, and SendGrid says regional sending in the EU is available for the Pro plan or above. Gzip-compressed mail bodies, sent with Content-Encoding: gzip, are available to some high volume accounts and need a request to support.
Other email APIs
Mailgun describes its APIs and tools as a way for developers to send, receive and track emails at scale. Postmark's API has a size limit of 10 MB for its Email API and 50 MB total payload for its Batch Email API. Whichever you use, getting into the inbox matters as much as the API, and my email deliverability checklist covers the basics. For how APIs differ from webhooks, see my API versus webhook explainer.
Want AI doing the heavy lifting in your marketing?
I build the systems that handle the boring 80 percent, so you get your week back. Done properly, with the human kept in.
My verdict on the SendGrid API
It's a straightforward REST API with libraries for the languages most teams use. Authenticate with a scoped API key, never a password, keep messages under 20MB, and set up Sender Authentication before your first real send. If you're running an old integration, move it to an API key now rather than waiting for it to fail.
Want your tool on this list? Featured spots and reviews here are paid partnerships. Here's how to partner with me.
Frequently asked questions
Does SendGrid have an API?
Yes, the Web REST API v3 at api.sendgrid.com/v3, with a Mail Send endpoint for sending email.
How do I authenticate?
With an API key sent as a Bearer token in the Authorization header. Basic Authentication is no longer accepted.
Which languages have official libraries?
PHP, Python, Node.js, Java, C#, Go and Ruby.
What is the maximum message size?
20MB in total, including headers and attachments.
Is there an EU endpoint?
Yes, api.eu.sendgrid.com for EU regional subusers, with regional sending available for the Pro plan or above.


