CONNECT APP
Build with Twilio SendGrid
Marketing
- API key
MCP
Give your agent Twilio SendGrid tools
Every Twilio SendGrid action is exposed as an MCP tool on Pipedream's remote server. Point a client at it with your end user's ID and Connect resolves that user's Twilio SendGrid account for each tool call — you store no tokens.
// accessToken: mint a short-lived token with the Connect SDK — see the MCP guide
const transport = new StreamableHTTPClientTransport(
new URL("https://remote.mcp.pipedream.net/v3"),
{
requestInit: {
headers: {
Authorization: `Bearer ${accessToken}`,
"x-pd-project-id": "{project_id}",
"x-pd-environment": "production",
"x-pd-external-user-id": "{external_user_id}", // any stable ID for this user in your system
"x-pd-app-slug": "sendgrid",
},
},
},
)
const mcp = new Client({ name: "my-agent", version: "1.0.0" })
await mcp.connect(transport)
const { tools } = await mcp.listTools()
// e.g. run Add Email to Global Suppression:
const result = await mcp.callTool({
name: "sendgrid-add-email-to-global-suppression",
arguments: {
recipientEmails: ["Recipient Emails"],
},
})# access_token: mint a short-lived token with the Connect SDK — see the MCP guide
headers = {
"Authorization": f"Bearer {access_token}",
"x-pd-project-id": "{project_id}",
"x-pd-environment": "production",
"x-pd-external-user-id": "{external_user_id}", # any stable ID for this user in your system
"x-pd-app-slug": "sendgrid",
}
async with streamablehttp_client("https://remote.mcp.pipedream.net/v3", headers=headers) as (read, write, _):
async with ClientSession(read, write) as session:
await session.initialize()
tools = await session.list_tools()
# e.g. run Add Email to Global Suppression:
result = await session.call_tool("sendgrid-add-email-to-global-suppression", {
"recipientEmails": ["Recipient Emails"],
})API PROXY
Call the Twilio SendGrid API directly
For an endpoint with no pre-built tool, the Connect proxy forwards your request to the Twilio SendGrid API with the connected user's credentials attached. You store no tokens and write no refresh logic.
const resp = await pd.proxy.get({
externalUserId: "{external_user_id}", // any stable ID for this user in your system
accountId: "apn_xxxxxxx",
url: "https://api.sendgrid.com/v3/user/account",
})
// Any allowed Twilio SendGrid endpoint works here. Pipedream attaches the
// connected account's credentials to the outgoing request.# The path segment is the target URL, URL-safe base64 encoded:
# https://api.sendgrid.com/v3/user/account
curl "https://api.pipedream.com/v1/connect/{project_id}/proxy/aHR0cHM6Ly9hcGkuc2VuZGdyaWQuY29tL3YzL3VzZXIvYWNjb3VudA?external_user_id={external_user_id}&account_id=apn_xxxxxxx" \
-H "Authorization: Bearer {access_token}" \
-H "x-pd-environment: production"SDK
Run Twilio SendGrid actions from your backend
Connect a user's Twilio SendGrid account once, then run Add Email to Global Suppression on their behalf from your own code — TypeScript, Python, or plain HTTP.
import { PipedreamClient } from "@pipedream/sdk"
const pd = new PipedreamClient({
projectId: process.env.PIPEDREAM_PROJECT_ID!,
clientId: process.env.PIPEDREAM_CLIENT_ID!,
clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
projectEnvironment: "production",
})
const result = await pd.actions.run({
id: "sendgrid-add-email-to-global-suppression",
externalUserId: "{external_user_id}", // any stable ID for this user in your system
configuredProps: {
sendgrid: { authProvisionId: "apn_xxxxxxx" },
recipientEmails: ["Recipient Emails"],
},
})from pipedream import Pipedream
pd = Pipedream(
client_id="{oauth_client_id}",
client_secret="{oauth_client_secret}",
project_id="{project_id}",
project_environment="production",
)
result = pd.actions.run(
id="sendgrid-add-email-to-global-suppression",
external_user_id="{external_user_id}", # any stable ID for this user in your system
configured_props={
"sendgrid": {"authProvisionId": "apn_xxxxxxx"},
"recipientEmails": ["Recipient Emails"],
},
)curl -X POST https://api.pipedream.com/v1/connect/{project_id}/actions/run \
-H "Content-Type: application/json" \
-H "X-PD-Environment: production" \
-H "Authorization: Bearer {access_token}" \
-d '{
"external_user_id": "{external_user_id}",
"id": "sendgrid-add-email-to-global-suppression",
"configured_props": {
"sendgrid": { "authProvisionId": "apn_xxxxxxx" },
"recipientEmails": ["Recipient Emails"]
}
}'TOOLS
Twilio SendGrid actions
On-demand operations your product or agent can configure and run on behalf of a connected user.
-
Add Email to Global Suppression
actionAllows you to add one or more email addresses to the global suppressions group. See the docs hereWritev0.0.6 -
Add or Update Contact
actionAdds or updates a contact. See the docs hereWritev0.0.6 -
Create Contact List
actionAllows you to create a new contact list. See the docs hereWritev0.0.6 -
Create Send
actionCreate a single send. See the docs hereWritev0.0.3 -
Delete Blocks
actionAllows you to delete all email addresses on your blocks list. See the docs hereWritev0.0.6 -
Delete Bounces
actionAllows you to delete all emails on your bounces list. See the docs hereWritev0.0.7 -
Delete Contacts
actionAllows you to delete one or more contacts. See the docs hereWritev0.0.7 -
Delete Global Suppression
actionAllows you to remove an email address from the global suppressions group. See the docs hereWritev0.0.6 -
Delete List
actionAllows you to delete a specific contact list. See the docs hereWritev0.0.6 -
Get a Block
actionGets a specific block. See the docs hereRead-onlyv0.0.6 -
Get A Global Suppression
actionGets a global suppression. See the docs hereRead-onlyv0.0.6 -
Get All Bounces
actionAllows you to get all of your bounces. See the docs hereRead-onlyv0.0.6 -
Get Contact Lists
actionAllows you to get details of your contact lists. See the docs hereRead-onlyv0.0.6 -
List ASM Group ID Options
actionRetrieves available options for the ASM Group ID field.Read-onlyv0.0.1 -
List ASM Groups to Display Options
actionRetrieves available options for the ASM Groups to Display field.Read-onlyv0.0.1 -
List Blocks
actionAllows you to list all email addresses that are currently on your blocks list. See the docs hereRead-onlyv0.0.6 -
List Categories Options
actionRetrieves available options for the Categories field.Read-onlyv0.0.1 -
List Design Id Options
actionRetrieves available options for the Design Id field.Read-onlyv0.0.1 -
List Email Options
actionRetrieves available options for the Email field.Read-onlyv0.0.1 -
List Email Options
actionRetrieves available options for the Email field.Read-onlyv0.0.1 -
List Emails Options
actionRetrieves available options for the Emails field.Read-onlyv0.0.1 -
List Emails Options
actionRetrieves available options for the Emails field.Read-onlyv0.0.1 -
List From Email Options
actionRetrieves available options for the From Email field.Read-onlyv0.0.1 -
List Global Suppressions
actionAllows you to get a list of all email address that are globally suppressed. See the docs hereRead-onlyv0.0.6 -
List Segment Ids Options
actionRetrieves available options for the Segment Ids field.Read-onlyv0.0.1 -
List Sender Id Options
actionRetrieves available options for the Sender Id field.Read-onlyv0.0.1 -
List Template ID Options
actionRetrieves available options for the Template ID field.Read-onlyv0.0.1 -
Remove Contact From List
actionAllows you to remove contacts from a given list. See the docs hereWritev0.0.6 -
Search Contacts
actionSearches contacts with a SGQL query. See the docs hereRead-onlyv0.0.6 -
Send Email Multiple Recipients
actionThis action sends a personalized e-mail to multiple specified recipients. See the docs hereWritev0.1.2 -
Send Email Single Recipient
actionThis action sends a personalized e-mail to the specified recipient. See the docs hereWritev0.1.2 -
Validate Email
actionValidates an email address. This action requires a Sendgrid's Pro or Premier plan. See the docs hereRead-onlyv0.0.7
EVENTS
Twilio SendGrid triggers
Event sources your backend can deploy for users and receive through a webhook.
MULTI-APP
Use Twilio SendGrid with other popular apps
Most products don't stop at one integration. Pair Twilio SendGrid with the other apps your users rely on, and ship use cases that span both.
- App slug
- sendgrid
- Authentication
- API key
- Categories
- Marketing
- Actions
- 32
- Triggers
- 2
- API proxy
- Available