Sendgrid API

Email / API Key Beginner HTTPS
Up to 10,000 requests/second (varies by plan)

Overview

SendGrid (now part of Twilio) is an industry-standard cloud email API for sending transactional and marketing emails at scale, with support for SMTP relay and REST API delivery. It handles email infrastructure, deliverability optimization, bounce management, and provides detailed event tracking (opens, clicks, bounces) via webhooks. An API key with appropriate permissions is required; a free tier allows 100 emails per day.

💡

Beginner Tip

SendGrid is the most widely used email API and has excellent documentation with code examples in every major language. Get your API key from the SendGrid dashboard, then send your first email with a single POST request — no SMTP configuration required.

Available Data

email delivery status
message ID
bounce/complaint data
open/click tracking
vehicle make and model
year and specifications

Example Response

JSON Response
{
  "message_id": "msg_abc123def456",
  "status": "delivered",
  "to": "[email protected]",
  "subject": "Welcome!",
  "timestamp": "2025-01-15T10:30:00Z"
}

Field Reference

(empty body, HTTP 202) A successful send returns HTTP 202 Accepted with an empty body — no message ID is returned synchronously
X-Message-Id Response header containing the SendGrid message ID for tracking this send through event webhooks
errors[].message Human-readable error description returned in the errors array when the request is rejected (4xx status)
errors[].field The specific request field that caused the validation error
errors[].help URL pointing to SendGrid documentation relevant to the specific error encountered

Implementation Example

// Send email via SendGrid API
const url = "https://api.sendgrid.com/v3/mail/send";
const payload = {
  personalizations: [{ to: [{ email: "[email protected]" }] }],
  from: { email: "[email protected]" },
  subject: "Hello from SendGrid",
  content: [{ type: "text/plain", value: "This is a test email" }]
};

const response = await fetch(url, {
  method: "POST",
  headers: {
    "Authorization": "Bearer YOUR_API_KEY",
    "Content-Type": "application/json"
  },
  body: JSON.stringify(payload)
});
if (!response.ok) throw new Error(`Request failed: ${response.status}`);
console.log("Email sent successfully!");

What Can You Build?

Note: These code examples are AI-generated and unverified. Always refer to the official API documentation for accurate usage.

Common Errors & Troubleshooting

403 Forbidden with "The provided authorization grant is invalid" The API key lacks the Mail Send permission, or was created for a different scope
In the SendGrid dashboard, edit the API key and enable the "Mail Send" permission under Mail Settings
Email delivered but ends up in spam folder Missing email authentication (SPF, DKIM) records on your sending domain
Complete domain authentication in the SendGrid dashboard by adding the provided DNS records — this is the single most impactful deliverability step
202 returned but recipient never receives the email The 202 means SendGrid accepted the message, not that delivery succeeded; bounces and blocks are reported separately
Set up event webhooks in the SendGrid dashboard to receive real-time delivery, bounce, and block events for your sends

Matrix Score Breakdown

🌐 Reachability 30/30
⚡ Speed 5/20
🔒 Security 15/15
🛠 Developer XP 12/20
✓ Reliability 10/15

Partially tested on Apr 5, 2026

Technical Specifications

Auth API Key
HTTPS REQUIRED
CORS UNKNOWN
Category Email
Difficulty Beginner
Verified: 2026-04-07

Alternatives to Sendgrid

Technical alternatives for different use cases.

Email forwarding for custom domains

Better For

Simple email forwarding without full email service

Trade-off

Bulk email sending and marketing automation

Email sending platform with built-in validation

Better For

Standalone email validation without sending needs

Trade-off

Combined email sending and validation in one platform

Email testing and sending with safe sandbox environment

Better For

Email testing in development and staging environments

Trade-off

Production email sending at high volume

Email marketing and transactional emails with generous free tier

Better For

Combined marketing and transactional email needs

Trade-off

High-volume transactional email at scale

Recipes Using Sendgrid

Build something with this API. Each recipe includes step-by-step instructions and code outlines.

Similar APIs

View All →