SendGrid Automation via Rube MCP
Automate SendGrid email delivery workflows including marketing campaigns (Single Sends), contact and list management, sender identity setup, and email analytics through Composio's SendGrid toolkit.
Prerequisites
- Rube MCP must be connected (RUBE_SEARCH_TOOLS available)
- Active SendGrid connection via
RUBE_MANAGE_CONNECTIONS with toolkit sendgrid
- Always call
RUBE_SEARCH_TOOLS first to get current tool schemas
Setup
Get Rube MCP: Add https://rube.app/mcp as an MCP server in your client configuration. No API keys needed — just add the endpoint and it works.
- Verify Rube MCP is available by confirming
RUBE_SEARCH_TOOLS responds
- Call
RUBE_MANAGE_CONNECTIONS with toolkit sendgrid
- If connection is not ACTIVE, follow the returned auth link to complete SendGrid API key authentication
- Confirm connection status shows ACTIVE before running any workflows
Core Workflows
1. Create and Send Marketing Campaigns (Single Sends)
When to use: User wants to create and send a marketing email campaign to a contact list or segment.
Tool sequence:
SENDGRID_RETRIEVE_ALL_LISTS - List available marketing lists to target [Prerequisite]
SENDGRID_CREATE_A_LIST - Create a new list if needed [Optional]
SENDGRID_ADD_OR_UPDATE_A_CONTACT - Add contacts to the list [Optional]
SENDGRID_GET_ALL_SENDER_IDENTITIES - Get verified sender ID [Prerequisite]
SENDGRID_CREATE_SINGLE_SEND - Create the campaign with content, sender, and recipients [Required]
Key parameters for SENDGRID_CREATE_SINGLE_SEND:
name: Campaign name (required)
email__config__subject: Email subject line
email__config__html__content: HTML body content
email__config__plain__content: Plain text version
email__config__sender__id: Verified sender identity ID
email__config__design__id: Use instead of html_content for pre-built designs
send__to__list__ids: Array of list UUIDs to send to
send__to__segment__ids: Array of segment UUIDs
send__to__all: true to send to all contacts
email__config__suppression__group__id or email__config__custom__unsubscribe__url: One required for compliance
Pitfalls:
- Setting
send_at on CREATE does NOT schedule the send; it only prepopulates the UI date; use the Schedule endpoint separately
send_at: "now" is only valid with the Schedule endpoint, not CREATE
- Must provide either
suppression_group_id or custom_unsubscribe_url for unsubscribe compliance
- Sender must be verified before use; check with
SENDGRID_GET_ALL_SENDER_IDENTITIES
- Nested params use double-underscore notation (e.g.,
email__config__subject)
2. Manage Contacts and Lists
When to use: User wants to create contact lists, add/update contacts, search for contacts, or remove contacts from lists.
Tool sequence:
SENDGRID_RETRIEVE_ALL_LISTS - List all marketing lists [Required]
SENDGRID_CREATE_A_LIST - Create a new contact list [Optional]
SENDGRID_GET_A_LIST_BY_ID - Get list details and sample contacts [Optional]
SENDGRID_ADD_OR_UPDATE_A_CONTACT - Upsert contacts with list association [Required]
SENDGRID_GET_CONTACTS_BY_EMAILS - Look up contacts by email [Optional]
SENDGRID_GET_CONTACTS_BY_IDENTIFIERS - Look up contacts by email, phone, or external ID [Optional]
SENDGRID_GET_LIST_CONTACT_COUNT - Verify contact count after operations [Optional]
SENDGRID_REMOVE_CONTACTS_FROM_A_LIST - Remove contacts from a list without deleting [Optional]
SENDGRID_REMOVE_LIST_AND_OPTIONAL_CONTACTS - Delete an entire list [Optional]
SENDGRID_IMPORT_CONTACTS - Bulk import from CSV [Optional]
Key parameters for SENDGRID_ADD_OR_UPDATE_A_CONTACT:
contacts: Array of contact objects (max 30,000 or 6MB), each with at least one identifier: email, phone_number_id, external_id, or anonymous_id (required)
list_ids: Array of list UUID strings to associate contacts with
Pitfalls:
SENDGRID_ADD_OR_UPDATE_A_CONTACT is asynchronous; returns 202 with job_id; contacts may take 10-30 seconds to appear
- List IDs are UUIDs (e.g., "ca7a3796-e8a8-4029-9ccb-df8937940562"), not integers
- List names must be unique; duplicate names cause 400 errors
SENDGRID_ADD_A_SINGLE_RECIPIENT_TO_A_LIST uses the legacy API; prefer SENDGRID_ADD_OR_UPDATE_A_CONTACT with list_ids
SENDGRID_REMOVE_LIST_AND_OPTIONAL_CONTACTS is irreversible; require explicit user confirmation
- Email addresses are automatically lowercased by SendGrid
3. Manage Sender Identities
When to use: User wants to set up or view sender identities (From addresses) for sending emails.
Tool sequence:
SENDGRID_GET_ALL_SENDER_IDENTITIES - List all existing sender identities [Required]
SENDGRID_CREATE_A_SENDER_IDENTITY - Create a new sender identity [Optional]
SENDGRID_VIEW_A_SENDER_IDENTITY - View details for a specific sender [Optional]
SENDGRID_UPDATE_A_SENDER_IDENTITY - Update sender details [Optional]
SENDGRID_CREATE_VERIFIED_SENDER_REQUEST - Create and verify a new sender [Optional]
SENDGRID_AUTHENTICATE_A_DOMAIN - Set up domain authentication for auto-verification [Optional]
Key parameters for SENDGRID_CREATE_A_SENDER_IDENTITY:
from__email: From email address (required)
from__name: Display name (required)
reply__to__email: Reply-to address (required)
nickname: Internal identifier (required)
address, city, country: Physical address for CAN-SPAM compliance (required)
Pitfalls:
- New senders must be verified before use; if domain is not authenticated, a verification email is sent
- Up to 100 unique sender identities per account
- Avoid using domains with strict DMARC policies (gmail.com, yahoo.com) as from addresses
SENDGRID_CREATE_VERIFIED_SENDER_REQUEST sends a verification email; sender is unusable until verified
4. View Email Statistics and Activity
When to use: User wants to review email delivery stats, bounce rates, open/click metrics, or message activity.
Tool sequence:
SENDGRID_RETRIEVE_GLOBAL_EMAIL_STATISTICS - Get account-wide delivery metrics [Required]
SENDGRID_GET_ALL_CATEGORIES - Discover available categories for filtering [Optional]
SENDGRID_RETRIEVE_EMAIL_STATISTICS_FOR_CATEGORIES - Get stats broken down by category [Optional]
SENDGRID_FILTER_ALL_MESSAGES - Search email activity feed by recipient, status, or date [Optional]
SENDGRID_FILTER_MESSAGES_BY_MESSAGE_ID - Get detailed events for a specific message [Optional]
SENDGRID_REQUEST_CSV - Export activity data as CSV for large datasets [Optional]
SENDGRID_DOWNLOAD_CSV - Download the exported CSV file [Optional]
Key parameters for SENDGRID_RETRIEVE_GLOBAL_EMAIL_STATISTICS:
start_date: Start date YYYY-MM-DD (required)
end_date: End date YYYY-MM-DD
aggregated_by: "day", "week", or "month"
limit / offset: Pagination (default 500)
Key parameters for SENDGRID_FILTER_ALL_MESSAGES:
query: SQL-like query string, e.g., status="delivered", to_email="user@example.com", date ranges with BETWEEN TIMESTAMP
limit: 1-1000 (default 10)
Pitfalls:
SENDGRID_FILTER_ALL_MESSAGES requires the "30 Days Additional Email Activity History" paid add-on; returns 403 without it
- Global statistics are nested under
details[].stats[0].metrics, not a flat structure
- Category statistics are only available for the previous 13 months
- Maximum 10 categories per request in
SENDGRID_RETRIEVE_EMAIL_STATISTICS_FOR_CATEGORIES
- CSV export is limited to one request per 12 hours; link expires after 3 days
5. Manage Suppressions
When to use: User wants to check or manage unsubscribe groups for email compliance.
Tool sequence:
SENDGRID_GET_SUPPRESSION_GROUPS - List all suppression groups [Required]
SENDGRID_RETRIEVE_ALL_SUPPRESSION_GROUPS_FOR_AN_EMAIL_ADDRESS - Check suppression status for a specific email [Optional]
Pitfalls:
- Suppressed addresses remain undeliverable even if present on marketing lists
- Campaign send counts may be lower than list counts due to suppressions
Common Patterns
ID Resolution
Always resolve names to IDs before operations:
- List name -> list_id:
SENDGRID_RETRIEVE_ALL_LISTS and match by name
- Sender name -> sender_id:
SENDGRID_GET_ALL_SENDER_IDENTITIES and match
- Contact email -> contact_id:
SENDGRID_GET_CONTACTS_BY_EMAILS with email array
- Template name -> template_id: Use the SendGrid UI or template endpoints
Pagination
SENDGRID_RETRIEVE_ALL_LISTS: Token-based with page_token and page_size (max 1000)
SENDGRID_RETRIEVE_GLOBAL_EMAIL_STATISTICS: Offset-based with limit (max 500) and offset
- Always paginate list retrieval to avoid missing existing lists
Async Operations
Contact operations (ADD_OR_UPDATE_A_CONTACT, IMPORT_CONTACTS) are asynchronous:
- Returns 202 with a
job_id
- Wait 10-30 seconds before verifying with
GET_CONTACTS_BY_EMAILS
- Use
GET_LIST_CONTACT_COUNT to confirm list growth
Known Pitfalls
ID Formats
- Marketing list IDs are UUIDs (e.g., "ca7a3796-e8a8-4029-9ccb-df8937940562")
- Legacy list IDs are integers; do not mix with Marketing API endpoints
- Sender identity IDs are integers
- Template IDs: Dynamic templates start with "d-", legacy templates are UUIDs
- Contact IDs are UUIDs
Rate Limits
- SendGrid may return HTTP 429; respect
Retry-After headers
- CSV export limited to one request per 12 hours
- Bulk contact upsert max: 30,000 contacts or 6MB per request
Parameter Quirks
- Nested params use double-underscore:
email__config__subject, from__email
send_at on CREATE_SINGLE_SEND only sets a UI default, does NOT schedule
SENDGRID_ADD_A_SINGLE_RECIPIENT_TO_A_LIST uses legacy API; recipient_id is Base64-encoded lowercase email
SENDGRID_RETRIEVE_ALL_LISTS and SENDGRID_GET_ALL_LISTS both exist; prefer RETRIEVE_ALL_LISTS for Marketing API
- Contact adds are async (202); always verify after a delay
Legacy vs Marketing API
- Some tools use the legacy Contact Database API (
/v3/contactdb/) which may return 403 on newer accounts
- Prefer Marketing API tools:
SENDGRID_ADD_OR_UPDATE_A_CONTACT, SENDGRID_RETRIEVE_ALL_LISTS, SENDGRID_CREATE_SINGLE_SEND
Quick Reference
| Task |
Tool Slug |
Key Params |
| List marketing lists |
SENDGRID_RETRIEVE_ALL_LISTS |
page_size, page_token |
| Create list |
SENDGRID_CREATE_A_LIST |
name |
| Get list by ID |
SENDGRID_GET_A_LIST_BY_ID |
id |
| Get list count |
SENDGRID_GET_LIST_CONTACT_COUNT |
id |
| Add/update contacts |
SENDGRID_ADD_OR_UPDATE_A_CONTACT |
contacts, list_ids |
| Search contacts by email |
SENDGRID_GET_CONTACTS_BY_EMAILS |
emails |
| Search by identifiers |
SENDGRID_GET_CONTACTS_BY_IDENTIFIERS |
identifier_type, identifiers |
| Remove from list |
SENDGRID_REMOVE_CONTACTS_FROM_A_LIST |
id, contact_ids |
| Delete list |
SENDGRID_REMOVE_LIST_AND_OPTIONAL_CONTACTS |
id, delete_contacts |
| Import contacts CSV |
SENDGRID_IMPORT_CONTACTS |
field mappings |
| Create Single Send |
SENDGRID_CREATE_SINGLE_SEND |
name, email__config__*, send__to__list__ids |
| List sender identities |
SENDGRID_GET_ALL_SENDER_IDENTITIES |
(none) |
| Create sender |
SENDGRID_CREATE_A_SENDER_IDENTITY |
from__email, from__name, address |
| Verify sender |
SENDGRID_CREATE_VERIFIED_SENDER_REQUEST |
from_email, nickname, address |
| Authenticate domain |
SENDGRID_AUTHENTICATE_A_DOMAIN |
domain |
| Global email stats |
SENDGRID_RETRIEVE_GLOBAL_EMAIL_STATISTICS |
start_date, aggregated_by |
| Category stats |
SENDGRID_RETRIEVE_EMAIL_STATISTICS_FOR_CATEGORIES |
start_date, categories |
| Filter email activity |
SENDGRID_FILTER_ALL_MESSAGES |
query, limit |
| Message details |
SENDGRID_FILTER_MESSAGES_BY_MESSAGE_ID |
msg_id |
| Export CSV |
SENDGRID_REQUEST_CSV |
query |
| Download CSV |
SENDGRID_DOWNLOAD_CSV |
download_uuid |
| List categories |
SENDGRID_GET_ALL_CATEGORIES |
(none) |
| Suppression groups |
SENDGRID_GET_SUPPRESSION_GROUPS |
(none) |
| Get template |
SENDGRID_RETRIEVE_A_SINGLE_TRANSACTIONAL_TEMPLATE |
template_id |
| Duplicate template |
SENDGRID_DUPLICATE_A_TRANSACTIONAL_TEMPLATE |
template_id, name |
When to Use
This skill is applicable to execute the workflow or actions described in the overview.
Example
User request:
Automate SendGrid email delivery workflows including marketing campaigns (Single Sends), contact and list management, sender identity setup, and email analytics through Composio's SendGrid toolkit.
Limitations
- Use this skill only when the task clearly matches the scope described above.
- Do not treat the output as a substitute for environment-specific validation, testing, or expert review.
- Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.
1---2name: sendgrid-automation3description: Automate SendGrid email delivery workflows including marketing campaigns (Single Sends), contact and list management, sender identity setup, and email analytics through Composio's SendGrid toolkit.4---5
6# SendGrid Automation via Rube MCP
7
8Automate SendGrid email delivery workflows including marketing campaigns (Single Sends), contact and list management, sender identity setup, and email analytics through Composio's SendGrid toolkit.
9
10## Prerequisites
11
12- Rube MCP must be connected (RUBE_SEARCH_TOOLS available)
13- Active SendGrid connection via `RUBE_MANAGE_CONNECTIONS` with toolkit `sendgrid`
14- Always call `RUBE_SEARCH_TOOLS` first to get current tool schemas
15
16## Setup
17
18**Get Rube MCP**: Add `https://rube.app/mcp` as an MCP server in your client configuration. No API keys needed — just add the endpoint and it works.
19
201. Verify Rube MCP is available by confirming `RUBE_SEARCH_TOOLS` responds
212. Call `RUBE_MANAGE_CONNECTIONS` with toolkit `sendgrid`
223. If connection is not ACTIVE, follow the returned auth link to complete SendGrid API key authentication
234. Confirm connection status shows ACTIVE before running any workflows
24
25## Core Workflows
26
27### 1. Create and Send Marketing Campaigns (Single Sends)
28
29**When to use**: User wants to create and send a marketing email campaign to a contact list or segment.
30
31**Tool sequence**:
321. `SENDGRID_RETRIEVE_ALL_LISTS` - List available marketing lists to target [Prerequisite]
332. `SENDGRID_CREATE_A_LIST` - Create a new list if needed [Optional]
343. `SENDGRID_ADD_OR_UPDATE_A_CONTACT` - Add contacts to the list [Optional]
354. `SENDGRID_GET_ALL_SENDER_IDENTITIES` - Get verified sender ID [Prerequisite]
365. `SENDGRID_CREATE_SINGLE_SEND` - Create the campaign with content, sender, and recipients [Required]
37
38**Key parameters for SENDGRID_CREATE_SINGLE_SEND**:
39- `name`: Campaign name (required)
40- `email__config__subject`: Email subject line
41- `email__config__html__content`: HTML body content
42- `email__config__plain__content`: Plain text version
43- `email__config__sender__id`: Verified sender identity ID
44- `email__config__design__id`: Use instead of html_content for pre-built designs
45- `send__to__list__ids`: Array of list UUIDs to send to
46- `send__to__segment__ids`: Array of segment UUIDs
47- `send__to__all`: true to send to all contacts
48- `email__config__suppression__group__id` or `email__config__custom__unsubscribe__url`: One required for compliance
49
50**Pitfalls**:
51- Setting `send_at` on CREATE does NOT schedule the send; it only prepopulates the UI date; use the Schedule endpoint separately
52- `send_at: "now"` is only valid with the Schedule endpoint, not CREATE
53- Must provide either `suppression_group_id` or `custom_unsubscribe_url` for unsubscribe compliance
54- Sender must be verified before use; check with `SENDGRID_GET_ALL_SENDER_IDENTITIES`
55- Nested params use double-underscore notation (e.g., `email__config__subject`)
56
57### 2. Manage Contacts and Lists
58
59**When to use**: User wants to create contact lists, add/update contacts, search for contacts, or remove contacts from lists.
60
61**Tool sequence**:
621. `SENDGRID_RETRIEVE_ALL_LISTS` - List all marketing lists [Required]
632. `SENDGRID_CREATE_A_LIST` - Create a new contact list [Optional]
643. `SENDGRID_GET_A_LIST_BY_ID` - Get list details and sample contacts [Optional]
654. `SENDGRID_ADD_OR_UPDATE_A_CONTACT` - Upsert contacts with list association [Required]
665. `SENDGRID_GET_CONTACTS_BY_EMAILS` - Look up contacts by email [Optional]
676. `SENDGRID_GET_CONTACTS_BY_IDENTIFIERS` - Look up contacts by email, phone, or external ID [Optional]
687. `SENDGRID_GET_LIST_CONTACT_COUNT` - Verify contact count after operations [Optional]
698. `SENDGRID_REMOVE_CONTACTS_FROM_A_LIST` - Remove contacts from a list without deleting [Optional]
709. `SENDGRID_REMOVE_LIST_AND_OPTIONAL_CONTACTS` - Delete an entire list [Optional]
7110. `SENDGRID_IMPORT_CONTACTS` - Bulk import from CSV [Optional]
72
73**Key parameters for SENDGRID_ADD_OR_UPDATE_A_CONTACT**:
74- `contacts`: Array of contact objects (max 30,000 or 6MB), each with at least one identifier: `email`, `phone_number_id`, `external_id`, or `anonymous_id` (required)
75- `list_ids`: Array of list UUID strings to associate contacts with
76
77**Pitfalls**:
78- `SENDGRID_ADD_OR_UPDATE_A_CONTACT` is asynchronous; returns 202 with `job_id`; contacts may take 10-30 seconds to appear
79- List IDs are UUIDs (e.g., "ca7a3796-e8a8-4029-9ccb-df8937940562"), not integers
80- List names must be unique; duplicate names cause 400 errors
81- `SENDGRID_ADD_A_SINGLE_RECIPIENT_TO_A_LIST` uses the legacy API; prefer `SENDGRID_ADD_OR_UPDATE_A_CONTACT` with `list_ids`
82- `SENDGRID_REMOVE_LIST_AND_OPTIONAL_CONTACTS` is irreversible; require explicit user confirmation
83- Email addresses are automatically lowercased by SendGrid
84
85### 3. Manage Sender Identities
86
87**When to use**: User wants to set up or view sender identities (From addresses) for sending emails.
88
89**Tool sequence**:
901. `SENDGRID_GET_ALL_SENDER_IDENTITIES` - List all existing sender identities [Required]
912. `SENDGRID_CREATE_A_SENDER_IDENTITY` - Create a new sender identity [Optional]
923. `SENDGRID_VIEW_A_SENDER_IDENTITY` - View details for a specific sender [Optional]
934. `SENDGRID_UPDATE_A_SENDER_IDENTITY` - Update sender details [Optional]
945. `SENDGRID_CREATE_VERIFIED_SENDER_REQUEST` - Create and verify a new sender [Optional]
956. `SENDGRID_AUTHENTICATE_A_DOMAIN` - Set up domain authentication for auto-verification [Optional]
96
97**Key parameters for SENDGRID_CREATE_A_SENDER_IDENTITY**:
98- `from__email`: From email address (required)
99- `from__name`: Display name (required)
100- `reply__to__email`: Reply-to address (required)
101- `nickname`: Internal identifier (required)
102- `address`, `city`, `country`: Physical address for CAN-SPAM compliance (required)
103
104**Pitfalls**:
105- New senders must be verified before use; if domain is not authenticated, a verification email is sent
106- Up to 100 unique sender identities per account
107- Avoid using domains with strict DMARC policies (gmail.com, yahoo.com) as from addresses
108- `SENDGRID_CREATE_VERIFIED_SENDER_REQUEST` sends a verification email; sender is unusable until verified
109
110### 4. View Email Statistics and Activity
111
112**When to use**: User wants to review email delivery stats, bounce rates, open/click metrics, or message activity.
113
114**Tool sequence**:
1151. `SENDGRID_RETRIEVE_GLOBAL_EMAIL_STATISTICS` - Get account-wide delivery metrics [Required]
1162. `SENDGRID_GET_ALL_CATEGORIES` - Discover available categories for filtering [Optional]
1173. `SENDGRID_RETRIEVE_EMAIL_STATISTICS_FOR_CATEGORIES` - Get stats broken down by category [Optional]
1184. `SENDGRID_FILTER_ALL_MESSAGES` - Search email activity feed by recipient, status, or date [Optional]
1195. `SENDGRID_FILTER_MESSAGES_BY_MESSAGE_ID` - Get detailed events for a specific message [Optional]
1206. `SENDGRID_REQUEST_CSV` - Export activity data as CSV for large datasets [Optional]
1217. `SENDGRID_DOWNLOAD_CSV` - Download the exported CSV file [Optional]
122
123**Key parameters for SENDGRID_RETRIEVE_GLOBAL_EMAIL_STATISTICS**:
124- `start_date`: Start date YYYY-MM-DD (required)
125- `end_date`: End date YYYY-MM-DD
126- `aggregated_by`: "day", "week", or "month"
127- `limit` / `offset`: Pagination (default 500)
128
129**Key parameters for SENDGRID_FILTER_ALL_MESSAGES**:
130- `query`: SQL-like query string, e.g., `status="delivered"`, `to_email="user@example.com"`, date ranges with `BETWEEN TIMESTAMP`
131- `limit`: 1-1000 (default 10)
132
133**Pitfalls**:
134- `SENDGRID_FILTER_ALL_MESSAGES` requires the "30 Days Additional Email Activity History" paid add-on; returns 403 without it
135- Global statistics are nested under `details[].stats[0].metrics`, not a flat structure
136- Category statistics are only available for the previous 13 months
137- Maximum 10 categories per request in `SENDGRID_RETRIEVE_EMAIL_STATISTICS_FOR_CATEGORIES`
138- CSV export is limited to one request per 12 hours; link expires after 3 days
139
140### 5. Manage Suppressions
141
142**When to use**: User wants to check or manage unsubscribe groups for email compliance.
143
144**Tool sequence**:
1451. `SENDGRID_GET_SUPPRESSION_GROUPS` - List all suppression groups [Required]
1462. `SENDGRID_RETRIEVE_ALL_SUPPRESSION_GROUPS_FOR_AN_EMAIL_ADDRESS` - Check suppression status for a specific email [Optional]
147
148**Pitfalls**:
149- Suppressed addresses remain undeliverable even if present on marketing lists
150- Campaign send counts may be lower than list counts due to suppressions
151
152## Common Patterns
153
154### ID Resolution
155Always resolve names to IDs before operations:
156- **List name -> list_id**: `SENDGRID_RETRIEVE_ALL_LISTS` and match by name
157- **Sender name -> sender_id**: `SENDGRID_GET_ALL_SENDER_IDENTITIES` and match
158- **Contact email -> contact_id**: `SENDGRID_GET_CONTACTS_BY_EMAILS` with email array
159- **Template name -> template_id**: Use the SendGrid UI or template endpoints
160
161### Pagination
162- `SENDGRID_RETRIEVE_ALL_LISTS`: Token-based with `page_token` and `page_size` (max 1000)
163- `SENDGRID_RETRIEVE_GLOBAL_EMAIL_STATISTICS`: Offset-based with `limit` (max 500) and `offset`
164- Always paginate list retrieval to avoid missing existing lists
165
166### Async Operations
167Contact operations (`ADD_OR_UPDATE_A_CONTACT`, `IMPORT_CONTACTS`) are asynchronous:
168- Returns 202 with a `job_id`
169- Wait 10-30 seconds before verifying with `GET_CONTACTS_BY_EMAILS`
170- Use `GET_LIST_CONTACT_COUNT` to confirm list growth
171
172## Known Pitfalls
173
174### ID Formats
175- Marketing list IDs are UUIDs (e.g., "ca7a3796-e8a8-4029-9ccb-df8937940562")
176- Legacy list IDs are integers; do not mix with Marketing API endpoints
177- Sender identity IDs are integers
178- Template IDs: Dynamic templates start with "d-", legacy templates are UUIDs
179- Contact IDs are UUIDs
180
181### Rate Limits
182- SendGrid may return HTTP 429; respect `Retry-After` headers
183- CSV export limited to one request per 12 hours
184- Bulk contact upsert max: 30,000 contacts or 6MB per request
185
186### Parameter Quirks
187- Nested params use double-underscore: `email__config__subject`, `from__email`
188- `send_at` on CREATE_SINGLE_SEND only sets a UI default, does NOT schedule
189- `SENDGRID_ADD_A_SINGLE_RECIPIENT_TO_A_LIST` uses legacy API; `recipient_id` is Base64-encoded lowercase email
190- `SENDGRID_RETRIEVE_ALL_LISTS` and `SENDGRID_GET_ALL_LISTS` both exist; prefer RETRIEVE_ALL_LISTS for Marketing API
191- Contact adds are async (202); always verify after a delay
192
193### Legacy vs Marketing API
194- Some tools use the legacy Contact Database API (`/v3/contactdb/`) which may return 403 on newer accounts
195- Prefer Marketing API tools: `SENDGRID_ADD_OR_UPDATE_A_CONTACT`, `SENDGRID_RETRIEVE_ALL_LISTS`, `SENDGRID_CREATE_SINGLE_SEND`
196
197## Quick Reference
198
199| Task | Tool Slug | Key Params |
200|------|-----------|------------|
201| List marketing lists | `SENDGRID_RETRIEVE_ALL_LISTS` | `page_size`, `page_token` |
202| Create list | `SENDGRID_CREATE_A_LIST` | `name` |
203| Get list by ID | `SENDGRID_GET_A_LIST_BY_ID` | `id` |
204| Get list count | `SENDGRID_GET_LIST_CONTACT_COUNT` | `id` |
205| Add/update contacts | `SENDGRID_ADD_OR_UPDATE_A_CONTACT` | `contacts`, `list_ids` |
206| Search contacts by email | `SENDGRID_GET_CONTACTS_BY_EMAILS` | `emails` |
207| Search by identifiers | `SENDGRID_GET_CONTACTS_BY_IDENTIFIERS` | `identifier_type`, `identifiers` |
208| Remove from list | `SENDGRID_REMOVE_CONTACTS_FROM_A_LIST` | `id`, `contact_ids` |
209| Delete list | `SENDGRID_REMOVE_LIST_AND_OPTIONAL_CONTACTS` | `id`, `delete_contacts` |
210| Import contacts CSV | `SENDGRID_IMPORT_CONTACTS` | field mappings |
211| Create Single Send | `SENDGRID_CREATE_SINGLE_SEND` | `name`, `email__config__*`, `send__to__list__ids` |
212| List sender identities | `SENDGRID_GET_ALL_SENDER_IDENTITIES` | (none) |
213| Create sender | `SENDGRID_CREATE_A_SENDER_IDENTITY` | `from__email`, `from__name`, `address` |
214| Verify sender | `SENDGRID_CREATE_VERIFIED_SENDER_REQUEST` | `from_email`, `nickname`, `address` |
215| Authenticate domain | `SENDGRID_AUTHENTICATE_A_DOMAIN` | `domain` |
216| Global email stats | `SENDGRID_RETRIEVE_GLOBAL_EMAIL_STATISTICS` | `start_date`, `aggregated_by` |
217| Category stats | `SENDGRID_RETRIEVE_EMAIL_STATISTICS_FOR_CATEGORIES` | `start_date`, `categories` |
218| Filter email activity | `SENDGRID_FILTER_ALL_MESSAGES` | `query`, `limit` |
219| Message details | `SENDGRID_FILTER_MESSAGES_BY_MESSAGE_ID` | `msg_id` |
220| Export CSV | `SENDGRID_REQUEST_CSV` | `query` |
221| Download CSV | `SENDGRID_DOWNLOAD_CSV` | `download_uuid` |
222| List categories | `SENDGRID_GET_ALL_CATEGORIES` | (none) |
223| Suppression groups | `SENDGRID_GET_SUPPRESSION_GROUPS` | (none) |
224| Get template | `SENDGRID_RETRIEVE_A_SINGLE_TRANSACTIONAL_TEMPLATE` | `template_id` |
225| Duplicate template | `SENDGRID_DUPLICATE_A_TRANSACTIONAL_TEMPLATE` | `template_id`, `name` |
226
227## When to Use
228This skill is applicable to execute the workflow or actions described in the overview.
229
230## Example
231
232**User request:**
233
234> Automate SendGrid email delivery workflows including marketing campaigns (Single Sends), contact and list management, sender identity setup, and email analytics through Composio's SendGrid toolkit.
235
236## Limitations
237- Use this skill only when the task clearly matches the scope described above.
238- Do not treat the output as a substitute for environment-specific validation, testing, or expert review.
239- Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.