What can you do with it?
The SendGrid API allows you to send transactional and marketing emails programmatically. You can send emails to multiple recipients, use dynamic templates, attach files, schedule emails for future delivery, manage sender verification, and handle all aspects of email delivery with high reliability and scalability.How to use it?
Basic Command Structure
Parameters
Required:action
- The action to perform (send, list, get, verify)entity
- The entity type (email, template, sender)to
- Recipient email addressfrom
- Sender email addresssubject
- Email subject linecontent
- Email content
cc
- Carbon copy recipientsbcc
- Blind carbon copy recipientstemplate_id
- Template ID for template-based emailsattachments
- File attachmentssend_at
- Scheduled send time (Unix timestamp)personalizations
- Personalization data
Tools
Send Basic Email
Send a basic email to multiple recipients including CC and BCC. Parameters:to
(required) - Primary recipient email addressfrom
(required) - Sender email addresssubject
(required) - Email subject linecontent
(required) - Email content with typecc
(optional) - Carbon copy recipientsbcc
(optional) - Blind carbon copy recipients
Send Template Email
Send an email using a pre-built dynamic template. Parameters:to
(required) - Recipient email addressfrom
(required) - Sender email addresssubject
(required) - Email subject linetemplate_id
(required) - Template IDcontent
(optional) - Default content if template failspersonalizations
(optional) - Template variables
Send Email with Attachment
Send an email with file attachments. Parameters:to
(required) - Recipient email addressfrom
(required) - Sender email addresssubject
(required) - Email subject linecontent
(required) - Email contentattachments
(required) - Array of attachment objects with content, type, filename, and disposition
Send Scheduled Email
Send an email at a specific scheduled time. Parameters:to
(required) - Recipient email addressfrom
(required) - Sender email addresssubject
(required) - Email subject linecontent
(required) - Email contentsend_at
(required) - Unix timestamp for scheduled send time
Get Sender ID
Retrieve sender ID information by email address. Parameters:email
(required) - Sender email address to look up
List Dynamic Templates
Retrieve a list of dynamic templates available in your SendGrid account. Parameters:generations
(optional) - Filter by template generation (dynamic, legacy)page_size
(optional) - Number of templates per page