SendGrid

Use SendGrid in Sim to send transactional emails, work with dynamic templates and attachments, and manage marketing contacts and lists. The action reference also covers template and suppression-group operations.

Usage Instructions

Integrate SendGrid into your workflow. Send transactional emails, manage marketing contacts and lists, and work with email templates. Supports dynamic templates, attachments, and comprehensive contact management.

Actions

SendGrid Send Mail

Send an email using SendGrid API

Input

ParameterTypeRequiredDescription
apiKeystringYesSendGrid API key
fromstringYesSender email address (must be verified in SendGrid)
fromNamestringNoSender name
tostringYesRecipient email address
toNamestringNoRecipient name
subjectstringNoEmail subject (required unless using a template with pre-defined subject)
contentstringNoEmail body content (required unless using a template with pre-defined content)
contentTypestringNoContent type (text/plain or text/html)
ccstringNoCC email address
bccstringNoBCC email address
replyTostringNoReply-to email address
replyToNamestringNoReply-to name
attachmentsfile[]NoFiles to attach to the email (UserFile objects)
templateIdstringNoSendGrid template ID to use
dynamicTemplateDatajsonNoJSON object of dynamic template data

Output

ParameterTypeDescription
successbooleanWhether the email was sent successfully
messageIdstringSendGrid message ID
tostringRecipient email address
subjectstringEmail subject

SendGrid Add Contact

Add a new contact to SendGrid

Input

ParameterTypeRequiredDescription
apiKeystringYesSendGrid API key
emailstringYesContact email address
firstNamestringNoContact first name
lastNamestringNoContact last name
customFieldsjsonNoJSON object of custom field key-value pairs (use field IDs like e1_T, e2_N, e3_D, not field names)
listIdsstringNoComma-separated list IDs to add the contact to

Output

ParameterTypeDescription
jobIdstringJob ID for tracking the async contact creation
emailstringContact email address
firstNamestringContact first name
lastNamestringContact last name
messagestringStatus message

SendGrid Get Contact

Get a specific contact by ID from SendGrid

Input

ParameterTypeRequiredDescription
apiKeystringYesSendGrid API key
contactIdstringYesContact ID

Output

ParameterTypeDescription
idstringContact ID
emailstringContact email address
firstNamestringContact first name
lastNamestringContact last name
createdAtstringCreation timestamp
updatedAtstringLast update timestamp
listIdsjsonArray of list IDs the contact belongs to
customFieldsjsonCustom field values

SendGrid Search Contacts

Search for contacts in SendGrid using a query

Input

ParameterTypeRequiredDescription
apiKeystringYesSendGrid API key
querystringYesSearch query (e.g., "email LIKE '%example.com%' AND CONTAINS(list_ids, 'list-id')")

Output

ParameterTypeDescription
contactsjsonArray of matching contacts
contactCountnumberTotal number of contacts found

SendGrid Delete Contacts

Delete one or more contacts from SendGrid

Input

ParameterTypeRequiredDescription
apiKeystringYesSendGrid API key
contactIdsstringYesComma-separated contact IDs to delete

Output

ParameterTypeDescription
jobIdstringJob ID for the deletion request

SendGrid Create List

Create a new contact list in SendGrid

Input

ParameterTypeRequiredDescription
apiKeystringYesSendGrid API key
namestringYesList name

Output

ParameterTypeDescription
idstringList ID
namestringList name
contactCountnumberNumber of contacts in the list

SendGrid Get List

Get a specific list by ID from SendGrid

Input

ParameterTypeRequiredDescription
apiKeystringYesSendGrid API key
listIdstringYesList ID

Output

ParameterTypeDescription
idstringList ID
namestringList name
contactCountnumberNumber of contacts in the list

SendGrid List All Lists

Get all contact lists from SendGrid

Input

ParameterTypeRequiredDescription
apiKeystringYesSendGrid API key
pageSizenumberNoNumber of lists to return per page (default: 100, max: 1000)
pageTokenstringNoPage token from a previous response (nextPageToken) to fetch the next page

Output

ParameterTypeDescription
listsjsonArray of lists
nextPageTokenstringToken to pass as pageToken to fetch the next page, if more results exist

SendGrid Delete List

Delete a contact list from SendGrid

Input

ParameterTypeRequiredDescription
apiKeystringYesSendGrid API key
listIdstringYesList ID to delete

Output

ParameterTypeDescription
messagestringSuccess message

SendGrid Add Contacts to List

Add or update contacts and assign them to a list in SendGrid (uses PUT /v3/marketing/contacts)

Input

ParameterTypeRequiredDescription
apiKeystringYesSendGrid API key
listIdstringYesList ID to add contacts to
contactsjsonYesJSON array of contact objects. Each contact must have at least: email (or phone_number_id/external_id/anonymous_id). Example: [{"email": "user@example.com", "first_name": "John"}]

Output

ParameterTypeDescription
jobIdstringJob ID for tracking the async operation
messagestringStatus message

SendGrid Remove Contacts from List

Remove contacts from a specific list in SendGrid

Input

ParameterTypeRequiredDescription
apiKeystringYesSendGrid API key
listIdstringYesList ID
contactIdsstringYesComma-separated contact IDs to remove from the list

Output

ParameterTypeDescription
jobIdstringJob ID for the request

SendGrid Create Template

Create a new email template in SendGrid

Input

ParameterTypeRequiredDescription
apiKeystringYesSendGrid API key
namestringYesTemplate name
generationstringNoTemplate generation type (legacy or dynamic, default: dynamic)

Output

ParameterTypeDescription
idstringTemplate ID
namestringTemplate name
generationstringTemplate generation
updatedAtstringLast update timestamp
versionsjsonArray of template versions

SendGrid Get Template

Get a specific template by ID from SendGrid

Input

ParameterTypeRequiredDescription
apiKeystringYesSendGrid API key
templateIdstringYesTemplate ID

Output

ParameterTypeDescription
idstringTemplate ID
namestringTemplate name
generationstringTemplate generation
updatedAtstringLast update timestamp
versionsjsonArray of template versions

SendGrid List Templates

Get all email templates from SendGrid

Input

ParameterTypeRequiredDescription
apiKeystringYesSendGrid API key
generationsstringNoFilter by generation (legacy, dynamic, or both)
pageSizenumberNoNumber of templates to return per page (default: 20, max: 200). When paginating with pageToken, pass the same pageSize used on the first request to keep page boundaries consistent.
pageTokenstringNoPage token from a previous response (nextPageToken) to fetch the next page

Output

ParameterTypeDescription
templatesjsonArray of templates
nextPageTokenstringToken to pass as pageToken to fetch the next page, if more results exist

SendGrid Delete Template

Delete an email template from SendGrid

Input

ParameterTypeRequiredDescription
apiKeystringYesSendGrid API key
templateIdstringYesTemplate ID to delete

Output

ParameterTypeDescription
successbooleanOperation success status
messagestringStatus or success message
messageIdstringEmail message ID (send_mail)
tostringRecipient email address (send_mail)
subjectstringEmail subject (send_mail, create_template_version)
idstringResource ID
jobIdstringJob ID for async operations
emailstringContact email address
firstNamestringContact first name
lastNamestringContact last name
createdAtstringCreation timestamp
updatedAtstringLast update timestamp
listIdsjsonArray of list IDs the contact belongs to
customFieldsjsonCustom field values
contactsjsonArray of contacts
contactCountnumberNumber of contacts
listsjsonArray of lists
namestringResource name
templatesjsonArray of templates
generationstringTemplate generation
versionsjsonArray of template versions
nextPageTokenstringToken for the next page of results (list_all_lists, list_templates)
templateIdstringTemplate ID
activebooleanWhether template version is active
htmlContentstringHTML content
plainContentstringPlain text content

SendGrid Create Template Version

Create a new version of an email template in SendGrid

Input

ParameterTypeRequiredDescription
apiKeystringYesSendGrid API key
templateIdstringYesTemplate ID
namestringYesVersion name
subjectstringYesEmail subject line
htmlContentstringNoHTML content of the template
plainContentstringNoPlain text content of the template
activebooleanNoWhether this version is active (default: true)

Output

ParameterTypeDescription
idstringVersion ID
templateIdstringTemplate ID
namestringVersion name
subjectstringEmail subject
activebooleanWhether this version is active
htmlContentstringHTML content
plainContentstringPlain text content
updatedAtstringLast update timestamp