Back to APIs
SendGrid
Send transactional emails reliably, manage marketing campaigns, and track opens, clicks, and bounces in real time.
Base URL
https://api.sendgrid.com/v3emailSMTPtemplatesanalyticscampaigns
Endpoints
POST
/mail/sendSend a transactional email.
const response = await fetch("https://api.sendgrid.com/v3/mail/send", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Authorization": "Bearer YOUR_ACCESS_TOKEN"
},
body: JSON.stringify({
"personalizations": [
{
"to": [
{
"email": "user@example.com"
}
]
}
],
"from": {
"email": "sender@yourdomain.com"
},
"subject": "Hello!",
"content": [
{
"type": "text/plain",
"value": "Test email"
}
]
})
});
const data = await response.json();
console.log(data);Response Preview
HTTP 202 Accepted (No body — check the X-Message-Id header for tracking) X-Message-Id: abc123xyz