Skip to main content

SendGrid

Connects to the SendGrid API for sending transactional emails and managing marketing contacts. An agent can send plain/HTML emails, send dynamic template emails, and add or search contacts.

Add to an agent node's tools array with _node_type: "tool-sendgrid". See Connector Reference — How connectors are used.

Authentication

FieldRequiredDescription
api_keyYesSendGrid API key, sent as Authorization: Bearer <api_key>. Typically a stored secret.
{
"name": "sendgrid",
"_node_type": "tool-sendgrid",
"api_key": "{{ secret.SENDGRID_API_KEY }}"
}

Tools

sendgrid_send_email

Send a transactional email via SendGrid.

Parameters

ParameterTypeRequiredDescription
tostringYesRecipient email address
to_namestringNoRecipient name
fromstringYesSender email address
from_namestringNoSender name
subjectstringYesEmail subject
html_contentstringNoHTML body
text_contentstringNoPlain text body

At least one of html_content or text_content is required.

Returns: A confirmation message with the recipient and HTTP status, e.g. "Email sent to <to> (status <code>)".

sendgrid_send_template

Send a dynamic template email via SendGrid.

Parameters

ParameterTypeRequiredDescription
tostringYesRecipient email
fromstringYesSender email
template_idstringYesDynamic template ID
dataobjectNoTemplate dynamic data

Returns: A confirmation message that the template email was sent to the recipient.

sendgrid_add_contact

Add or update a contact in SendGrid Marketing.

Parameters

ParameterTypeRequiredDescription
emailstringYesContact email
first_namestringNoFirst name
last_namestringNoLast name
list_idstringNoContact list ID to add to

Returns: A confirmation message that the contact was added/updated.

sendgrid_list_contacts

Search contacts in SendGrid Marketing.

Parameters

ParameterTypeRequiredDescription
querystringNoSearch query (e.g. email LIKE '%@example.com'); defaults to email != ''

Returns: A count line followed by a newline-separated list of <first_name> <<email>> lines.

Next