SendGrid
API actions for the SendGrid integration.
SendGrid
Send reliable transactional emails and manage SendGrid marketing contacts.
Add contact to list
Add contacts to a SendGrid marketing list.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
email | string | Yes | Contact email address to add. |
list_ids | array | Yes | Marketing list IDs to add the contact to. |
Response
{
"job_id": "job_987"
}Create marketing list
Create a marketing list for SendGrid contacts.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
name | string | Yes | List name. |
Response
{
"contact_count": 0,
"id": "list_789",
"name": "My List"
}Get email stats
Retrieve SendGrid email statistics for a date range.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
start_date | string | Yes | Start date (YYYY-MM-DD). |
end_date | string | Yes | End date (YYYY-MM-DD). |
Response
{
"stats": [
{
"date": "2024-01-01",
"stats": [
{
"metrics": {
"clicks": 10,
"delivered": 95,
"opens": 50,
"requests": 100
}
}
]
}
]
}List templates
List SendGrid email templates.
Response
{
"result": [
{
"id": "tmpl_123",
"name": "Welcome Email"
}
]
}Search contacts
Search SendGrid marketing contacts.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
query | string | Yes | Search query string (SendGrid SGQL syntax). |
Response
{
"contact_count": 1,
"result": [
{
"email": "jane@example.com",
"first_name": "Jane",
"last_name": "Doe"
}
]
}Send email
Send an email using SendGrid's v3 mail send API.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
from_email | string | Yes | Sender email address. |
to_email | string | Yes | Recipient email address. |
subject | string | Yes | Email subject. |
text_content | string | Yes | Plain text email content. |
html_content | string | No | Optional HTML email content. |
cc | array | No | Optional CC email addresses. |
bcc | array | No | Optional BCC email addresses. |
Response
{
"status_code": 202
}Send template email
Send a transactional email using a SendGrid dynamic template.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
from_email | string | Yes | Sender email address. |
to_email | string | Yes | Recipient email address. |
template_id | string | Yes | SendGrid dynamic template ID. |
dynamic_data | object | No | Template substitution data. |
Response
{
"status_code": 202
}