Sendgrid
Trusted for reliable email delivery at scale.
Categories: Communication, Marketing Automation
Type: sendgrid/v1
Connections
Version: 1
Bearer Token
Properties
| Name | Label | Type | Description | Required |
|---|---|---|---|---|
| token | Token | STRING | true |
Connection Setup
- Open your Dashboard: https://app.sendgrid.com .
- Click on Settings and choose API Keys.
- Click on Create API Key.
- Enter API Key Name, choose Full Access permissions and click on Create & View.
- Copy your generated API key and use it in Bytechef.
Actions
Send Email
Name: sendEmail
Sends an email.
Properties
| Name | Label | Type | Description | Required |
|---|---|---|---|---|
| from | From | STRING | Email address from which you want to send. | true |
| to | To | ARRAY Items[STRING] | Email addresses which you want to send to. | true |
| cc | CC | ARRAY Items[STRING] | Email address which receives a copy. | false |
| subject | Subject | STRING | Subject of your email. | true |
| text | Message Body | STRING | The message you want to send. | true |
| type | Message Type | STRING Optionstext/plain, text/html | Message type for your content. | true |
| attachments | Attachments | ARRAY Items[FILE_ENTRY] | A list of attachments you want to include with the email. | false |
Example JSON Structure
{
"label" : "Send Email",
"name" : "sendEmail",
"parameters" : {
"from" : "",
"to" : [ "" ],
"cc" : [ "" ],
"subject" : "",
"text" : "",
"type" : "",
"attachments" : [ {
"extension" : "",
"mimeType" : "",
"name" : "",
"url" : ""
} ]
},
"type" : "sendgrid/v1/sendEmail"
}Output
This action does not produce any output.
Send Dynamic Template
Name: sendDynamicTemplate
Send an email using a dynamic template.
Properties
| Name | Label | Type | Description | Required |
|---|---|---|---|---|
| from | From | STRING | Email address from which you want to send. | true |
| to | To | ARRAY Items[STRING] | Email addresses which you want to send to. | true |
| cc | CC | ARRAY Items[STRING] | Email address which receives a copy. | false |
| template_id | Template ID | STRING | Dynamic template ID. | true |
| dynamic_template_data | Dynamic Template Data | OBJECT Properties{} | Data passed to the SendGrid dynamic template. | false |
| attachments | Attachments | ARRAY Items[FILE_ENTRY] | A list of attachments you want to include with the email. | false |
Example JSON Structure
{
"label" : "Send Dynamic Template",
"name" : "sendDynamicTemplate",
"parameters" : {
"from" : "",
"to" : [ "" ],
"cc" : [ "" ],
"template_id" : "",
"dynamic_template_data" : { },
"attachments" : [ {
"extension" : "",
"mimeType" : "",
"name" : "",
"url" : ""
} ]
},
"type" : "sendgrid/v1/sendDynamicTemplate"
}Output
This action does not produce any output.
Find Template ID
To find the Template ID, click here.
List Contact Lists
Name: listContactLists
Lists all Marketing Campaigns contact lists in the SendGrid account.
Example JSON Structure
{
"label" : "List Contact Lists",
"name" : "listContactLists",
"type" : "sendgrid/v1/listContactLists"
}Output
Type: ARRAY
Items Type: OBJECT
Properties
| Name | Type | Description |
|---|---|---|
| id | STRING | The ID of the contact list. |
| name | STRING | The name of the contact list. |
| contact_count | INTEGER | The number of contacts on the list. |
Output Example
[ {
"id" : "",
"name" : "",
"contact_count" : 1
} ]List Senders
Name: listSenders
Lists all Marketing Campaigns senders. Only verified senders can be used to send a Single Send.
Example JSON Structure
{
"label" : "List Senders",
"name" : "listSenders",
"type" : "sendgrid/v1/listSenders"
}Output
Type: ARRAY
Items Type: OBJECT
Properties
| Name | Type | Description |
|---|---|---|
| id | INTEGER | The ID of the sender. |
| nickname | STRING | The nickname of the sender. |
| from | OBJECT Properties{STRING(email), STRING(name)} | |
| reply_to | OBJECT Properties{STRING(email), STRING(name)} | |
| verified | BOOLEAN Optionstrue, false | Whether the sender is verified. |
| locked | BOOLEAN Optionstrue, false | Whether the sender is used by a draft or scheduled send. |
Output Example
[ {
"id" : 1,
"nickname" : "",
"from" : {
"email" : "",
"name" : ""
},
"reply_to" : {
"email" : "",
"name" : ""
},
"verified" : false,
"locked" : false
} ]Create Single Send
Name: createSingleSend
Creates a draft Marketing Campaigns Single Send. Use Schedule Single Send to send it.
Properties
| Name | Label | Type | Description | Required |
|---|---|---|---|---|
| name | Name | STRING | The name of the Single Send. | true |
| subject | Subject | STRING | The subject line of the email. | true |
| htmlContent | HTML Content | STRING | The HTML content of the email. | true |
| senderId | Sender ID | INTEGER | The ID of the verified sender the email is sent from. | true |
| listIds | List IDs | ARRAY Items[STRING] | The IDs of the contact lists the Single Send is sent to. | true |
| suppressionGroupId | Unsubscribe Group ID | INTEGER | The ID of the unsubscribe group recipients can opt out of. Scheduling requires either an unsubscribe group or a custom unsubscribe URL. | false |
| customUnsubscribeUrl | Custom Unsubscribe URL | STRING | The URL of your own unsubscribe page, used instead of an unsubscribe group. | false |
Example JSON Structure
{
"label" : "Create Single Send",
"name" : "createSingleSend",
"parameters" : {
"name" : "",
"subject" : "",
"htmlContent" : "",
"senderId" : 1,
"listIds" : [ "" ],
"suppressionGroupId" : 1,
"customUnsubscribeUrl" : ""
},
"type" : "sendgrid/v1/createSingleSend"
}Output
Type: OBJECT
Properties
| Name | Type | Description |
|---|---|---|
| id | STRING | The ID of the Single Send. Pass it to Schedule Single Send. |
| name | STRING | The name of the Single Send. |
| status | STRING | The status of the Single Send: draft, scheduled or triggered. |
| send_at | STRING | The scheduled send time, when one is set. |
| send_to | OBJECT Properties{[STRING](list_ids)} | |
| email_config | OBJECT Properties{STRING(subject), STRING(html_content), INTEGER(sender_id), INTEGER(suppression_group_id), STRING(custom_unsubscribe_url)} | |
| created_at | STRING | The time the Single Send was created. |
| updated_at | STRING | The time the Single Send was last updated. |
Output Example
{
"id" : "",
"name" : "",
"status" : "",
"send_at" : "",
"send_to" : {
"list_ids" : [ "" ]
},
"email_config" : {
"subject" : "",
"html_content" : "",
"sender_id" : 1,
"suppression_group_id" : 1,
"custom_unsubscribe_url" : ""
},
"created_at" : "",
"updated_at" : ""
}Before you schedule
SendGrid creates the Single Send as a draft. Before you schedule it with Schedule Single Send, make sure that:
- The sender is verified. Use List Senders to check the
verifiedflag. - The Single Send has either an Unsubscribe Group ID or a Custom Unsubscribe URL.
- The API key has access to Marketing Campaigns. A key with Full Access permissions does.
Schedule Single Send
Name: scheduleSingleSend
Schedules a Marketing Campaigns Single Send, or sends it immediately.
Properties
| Name | Label | Type | Description | Required |
|---|---|---|---|---|
| singleSendId | Single Send ID | STRING | The ID of the Single Send, as returned by Create Single Send. | true |
| sendAt | Send At | STRING | When to send the Single Send: a future ISO 8601 date-time such as 2026-12-01T09:00:00Z, or now to send it immediately. | true |
Example JSON Structure
{
"label" : "Schedule Single Send",
"name" : "scheduleSingleSend",
"parameters" : {
"singleSendId" : "",
"sendAt" : ""
},
"type" : "sendgrid/v1/scheduleSingleSend"
}Output
Type: OBJECT
Properties
| Name | Type | Description |
|---|---|---|
| send_at | STRING | The time the Single Send is scheduled to be sent. |
| status | STRING | The status of the Single Send, scheduled on success. |
Output Example
{
"send_at" : "",
"status" : ""
}What to do if your action is not listed here?
If this component doesn't have the action you need, you can use Custom Action to create your own. Custom Actions empower you to define HTTP requests tailored to your specific requirements, allowing for greater flexibility in integrating with external services or APIs.
To create a Custom Action, simply specify the desired HTTP method, path, and any necessary parameters. This way, you can extend the functionality of your component beyond the predefined actions, ensuring that you can meet all your integration needs effectively.
Additional Instructions
How to find Template ID
- Method 1: Via UI
To find a Template ID, open your dashboard. In the left bar choose Email API -> Dynamic Templates. Expand the template you want to use and there you will find Template ID.
- Method 2: Via API
Use the GET /templates?generations=dynamic endpoint to retrieve a list of all dynamic templates and their IDs.
How is this guide?
Last updated on
SendFox
SendFox lets you automate email campaigns, complete with custom opt-in forms and landing pages, so you're not tanking your budget to get new subscribers.
Sentry
Sentry is an application monitoring platform that helps developers find, triage and fix errors and performance problems in their code.