canonical: https://jentic.com/apis/sendgrid.com/sendgrid-mail

# Sendgrid Twilio SendGrid Mail API

Send transactional and marketing emails at scale over HTTP with support for templates, categories, open and click tracking, and batch scheduling. Group mail sends into batches that can be scheduled, paused, or cancelled by batch ID. Supports global and EU-regional endpoints for data residency compliance.

## For AI agents

Send emails at scale via HTTP, manage batch sends, and track delivery with open and click analytics. Supports templates and scheduling.

## Scope

Does not handle SMS, push notifications, or contact list management - use for email delivery and batch scheduling only.

## Capabilities

- Deliver transactional emails with dynamic template substitution and category tagging
- Schedule email batches for future delivery with pause and cancel controls
- Track recipient engagement through open and click event tracking
- Route mail through global or EU-regional endpoints for data residency
- Attach files, embed images, and set custom headers per recipient
- Configure sandbox mode for testing sends without actual delivery
- Tag sends with custom arguments for downstream analytics filtering

## Use cases

### AI Agent Email Automation

AI agents send transactional emails through Jentic by searching for the send email operation, loading the request schema, and executing with recipient, subject, and content fields. Jentic handles bearer token injection and schema validation so the agent never touches raw API keys. A single API call to POST /v3/mail/send delivers the message with full template and tracking support.

Example prompt: Send a transactional email to user@example.com with subject 'Order Confirmation' using template ID d-abc123 and verify the 202 accepted response

### Batch Email Scheduling

Schedule large volumes of marketing or transactional emails for future delivery by generating a batch ID and assigning it to individual sends. The API supports pausing or cancelling entire batches before their scheduled send time, giving operations teams control over time-sensitive campaigns without rebuilding send lists.

Example prompt: Create a new mail batch via POST /v3/mail/batch, then send 3 emails assigned to that batch ID with a send_at timestamp of tomorrow 9:00 AM UTC

### Transactional Order Notifications

Trigger real-time email notifications for e-commerce events like order confirmations, shipping updates, and delivery receipts. Each send supports dynamic template data substitution, allowing personalized content per recipient without maintaining multiple templates. Open and click tracking provide visibility into engagement rates for critical communications.

Example prompt: Send an order confirmation email to a customer with dynamic data including order_id, item_list, and total_amount using a SendGrid dynamic template

### Multi-Region Email Delivery

Route email sends through region-specific endpoints to comply with data residency requirements. The EU endpoint at api.eu.sendgrid.com processes mail within the European Union, while the global endpoint handles all other traffic. This requires no code changes beyond switching the base URL, making it straightforward for applications serving international users.

Example prompt: Send a GDPR-compliant email through the EU regional endpoint at https://api.eu.sendgrid.com/v3/mail/send with tracking disabled for a European subscriber

## Key endpoints

| Method | Path | Description |
| --- | --- | --- |
| POST | /v3/mail/send | Send an email with full template, tracking, and personalization support |
| POST | /v3/mail/batch | Generate a batch ID for grouping scheduled sends |
| GET | /v3/mail/batch/{batch_id} | Retrieve the status of a mail batch |

## Key resources

- **Mail Send** — Send emails with templates, attachments, tracking, categories, and scheduling
- **Mail Batch** — Group scheduled sends into batches for collective pause or cancel operations

## Why Jentic

- **Setup:** Wiring the Twilio SendGrid Mail API by hand means learning its bearer API key auth, picking the right global api.sendgrid.com or EU api.eu.sendgrid.com host, and handling batch scheduling and retries yourself. Through Jentic you install once, import the Mail API from the API Directory, store the API key once, and your agent calls it.
- **Permission scoping:** This API sends email and manages batches through a small set of operations, so limit the agent to the operations it needs, such as sending mail with POST /v3/mail/send. You choose the operations it may call, so cancelling or scheduling a batch is not included unless you add it.
- **Credential handling:** Your Twilio SendGrid API key is stored once, encrypted, by your own Jentic One instance and injected at execution time. It never enters the agent's prompt, logs, or context.
- **Discovery method:** Agents search Jentic by intent such as 'send a transactional email' or 'check a batch status', and Jentic returns the matching Twilio SendGrid Mail API operation with its input schema so the agent calls the right endpoint without browsing the reference docs.

## Related APIs

- **Mailjet API** — Mailjet offers similar transactional email delivery with built-in A/B testing and real-time monitoring
- **Postmark Server API** — Postmark focuses exclusively on transactional email with industry-leading delivery speed
- **Twilio API** — Twilio adds SMS, voice, and phone number management alongside SendGrid email
- **Brevo API** — Brevo combines transactional email with SMS and CRM in a single platform

## FAQ

### What authentication does the SendGrid Mail API use?

The SendGrid Mail API uses Bearer token authentication. You include your API key in the Authorization header as 'Bearer SG.your-api-key'. Through Jentic, your SendGrid API key is stored encrypted in your Jentic One instance and injected automatically into requests, so agents never handle raw credentials.

### Can I schedule emails for future delivery with the SendGrid Mail API?

Yes. First create a batch ID via POST /v3/mail/batch, then include that batch_id and a send_at Unix timestamp in your mail send request. You can later retrieve the batch status via GET /v3/mail/batch/{batch_id} to verify scheduling or cancel the batch before delivery.

### What are the rate limits for the SendGrid Mail API?

SendGrid enforces rate limits based on your plan tier. Free accounts allow 100 emails per day. Pro plans support higher throughput with burst limits on the /v3/mail/send endpoint. The API returns a 429 status code with a Retry-After header when limits are reached.

### How do I send a templated email through Jentic?

Search for 'send a transactional email' in Jentic, load the SendGrid mail send operation schema, then execute with your template_id in the request body along with dynamic_template_data for personalization. Jentic injects the bearer token automatically. Install with pip install jentic and use the search-load-execute flow.

### Does the SendGrid Mail API support attachments?

Yes. Include base64-encoded file content in the attachments array of the POST /v3/mail/send request body. Each attachment requires a filename, content (base64), and type (MIME type). The API supports multiple attachments per message with a total message size limit of 30MB.

### Can I use separate endpoints for EU data residency?

Yes. SendGrid provides a dedicated EU endpoint at https://api.eu.sendgrid.com for subusers provisioned in the EU region. The API contract is identical to the global endpoint - only the base URL changes. This ensures email processing stays within EU boundaries for GDPR compliance.

### Can I limit what my agent is allowed to do with the SendGrid Mail API?

Yes. Because you run Jentic One yourself, your own rules decide which SendGrid Mail operations and credentials the agent may use. You can allow only sending mail through POST /v3/mail/send and withhold the batch operations, so the agent cannot create a batch via POST /v3/mail/batch or read batch status via GET /v3/mail/batch/{batch_id} unless you grant them. Your encrypted API key is injected at execution time and never reaches the agent's prompt or logs.
