VX Agents

OpenAPI Marketplace · Email

SendGrid Email

v1.0.0 · 10 endpoints · 0 connections · shared by vx.ai

Send transactional email (plain or from a dynamic template), look up templates, check bounces and unsubscribes before sending, and search or upsert Marketing Campaigns contacts. Based on the SendGrid API specification.

Connect this API to an AI agent Browse all specs

What you can do with SendGrid Email via MCP

Every endpoint below becomes a governed tool your AI agent (Claude, ChatGPT, or a customer-facing VX agent) can call — with scoped permissions, sandbox testing, and audit logs.

MethodPathOperationDescription
GET /templates listTemplates List transactional email templates
GET /templates/{template_id} getTemplate Get a template with its versions
GET /suppression/bounces listBounces List bounced email addresses
GET /suppression/bounces/{email} getBounce Check whether an address has bounced
GET /suppression/unsubscribes listGlobalUnsubscribes List addresses that unsubscribed from all email
GET /asm/suppressions/{email} getSuppressionGroupsForEmail Show which unsubscribe groups an address has left
POST /marketing/contacts/search searchContacts Search marketing contacts with a query
POST /marketing/contacts/search/emails getContactsByEmails Find marketing contacts by email address
PUT /marketing/contacts upsertContacts Add or update marketing contacts
POST /mail/send sendMail Send an email

Authentication

BearerAuth

Bearer token — sent as Authorization: Bearer <token>

SendGrid API key sent as Authorization: Bearer <API key>.

How to get a credential

  1. Sign in to SendGrid (app.sendgrid.com).
  2. Open Settings > API Keys and click Create API Key.
  3. Choose Restricted Access and grant the permissions below.
  4. Copy the key (it starts with SG.). It is shown only once.
  5. Make sure the sender address or domain is verified under Settings > Sender Authentication.

Permissions used

Permission Operations
Mail Send: Full Access sendMail
Template Engine: Read Access listTemplates, getTemplate
Suppressions: Read Access listBounces, getBounce, listGlobalUnsubscribes, getSuppressionGroupsForEmail
Marketing: Read Access searchContacts, getContactsByEmails
Marketing: Full Access upsertContacts

Common errors

  • 401 Unauthorized: the key is wrong, deleted or missing the Bearer prefix.
  • 403 Forbidden: the key lacks the permission for that call (edit the key's scopes), or the from address is not a verified sender.
  • 400 Bad Request: invalid JSON body, e.g. missing personalizations, from, or content/template_id.
  • 429 Too Many Requests: rate limit hit; wait for the time in X-RateLimit-Reset.

Store the key as a VX Agents credential (Bearer token); never paste it into chat.

Usage guide

Setup

  • Add a SendGrid API key (Settings > API Keys, restricted access) as the Bearer credential.
  • Pin your verified sender address (from.email, plus from.name) so every send uses it. Leave on-behalf-of empty unless you send for a subuser.

Send a transactional email

  1. To use a template, call listTemplates with generations=dynamic and page_size (required, max 200), then getTemplate to see the active version and its {{variables}}.
  2. Before sending, check the recipient: getBounce (bounced address) and getSuppressionGroupsForEmail (unsubscribe groups). Skip or warn on suppressed addresses.
  3. Show the user the recipient, subject and content (or template + data) and get confirmation.
  4. Call sendMail with personalizations (to, optional dynamic_template_data), from, and either subject + content (text/plain and/or text/html) or template_id. A 202 with an empty body means accepted for delivery.

Manage marketing contacts

  1. Look up people with getContactsByEmails (emails list) or searchContacts (query in SGQL, e.g. email LIKE '%@acme.com').
  2. Confirm changes with the user, then call upsertContacts with contacts (email required; names, custom fields) and optional list_ids. It returns a job_id; processing is asynchronous and takes a few minutes.

Deliverability checks

  • listBounces and listGlobalUnsubscribes accept start_time / end_time (Unix seconds); listGlobalUnsubscribes also pages with limit / offset.

Good to know

  • Sending email and changing contacts affect real customers: always confirm sendMail and upsertContacts before calling them.
  • sendMail limits: up to 1,000 personalizations per request; total message size up to 30 MB.
  • Template ids look like d-... for dynamic templates.
  • Timestamps in suppression lists are Unix seconds.
  • 429 responses include X-RateLimit-Reset; wait before retrying.

How to use this spec

  1. Create a free VX Agents account (sandbox tools included).
  2. Open the marketplace and connect “SendGrid Email” to an agent.
  3. Expose it as an MCP server for Claude/ChatGPT, or chat with it directly.

Related APIs