tools/integrations/sendgrid.md
Email delivery platform for transactional and marketing emails.
| Integration | Available | Notes |
|---|---|---|
| API | ✓ | Mail Send API, Marketing API |
| MCP | - | Not available |
| CLI | - | Not available |
| SDK | ✓ | Official libraries for most languages |
Authorization: Bearer {api_key}POST https://api.sendgrid.com/v3/mail/send
Authorization: Bearer {api_key}
{
"personalizations": [{
"to": [{"email": "[email protected]"}]
}],
"from": {"email": "[email protected]"},
"subject": "Welcome!",
"content": [{
"type": "text/html",
"value": "<h1>Welcome!</h1>"
}]
}
POST https://api.sendgrid.com/v3/mail/send
{
"personalizations": [{
"to": [{"email": "[email protected]"}],
"dynamic_template_data": {
"name": "John",
"order_id": "12345"
}
}],
"from": {"email": "[email protected]"},
"template_id": "d-xxx"
}
PUT https://api.sendgrid.com/v3/marketing/contacts
{
"list_ids": ["list-id"],
"contacts": [{
"email": "[email protected]",
"first_name": "John",
"last_name": "Doe"
}]
}
POST https://api.sendgrid.com/v3/marketing/contacts/search
{
"query": "email LIKE 'user@%'"
}
GET https://api.sendgrid.com/v3/stats?start_date=2024-01-01&end_date=2024-01-31
Authorization: Bearer {api_key}
GET https://api.sendgrid.com/v3/suppression/bounces
Authorization: Bearer {api_key}
GET https://api.sendgrid.com/v3/suppression/spam_reports
Authorization: Bearer {api_key}
POST https://api.sendgrid.com/v3/validations/email
{
"email": "[email protected]"
}
| Event | Description |
|---|---|
processed | Email accepted |
delivered | Email delivered |
open | Email opened |
click | Link clicked |
bounce | Hard/soft bounce |
dropped | Email dropped |
spamreport | Marked as spam |
unsubscribe | Unsubscribed |
const sgMail = require('@sendgrid/mail');
sgMail.setApiKey('SG.xxx');
await sgMail.send({
to: '[email protected]',
from: '[email protected]',
subject: 'Welcome!',
html: '<h1>Welcome!</h1>'
});