GuideOpen

SendGrid

Email delivery platform for transactional and marketing emails.

SendGrid

Email delivery platform for transactional and marketing emails.

Capabilities

IntegrationAvailableNotes
API✓Mail Send API, Marketing API
MCP-Not available
CLI-Not available
SDK✓Official libraries for most languages

Authentication

  • Type: API Key
  • Header: Authorization: Bearer {api_key}
  • Get key: Settings > API Keys in SendGrid dashboard

Common Agent Operations

Send email

POST https://api.sendgrid.com/v3/mail/send

Authorization: Bearer {api_key}

{
  "personalizations": [{
    "to": [{"email": "[email removed]"}]
  }],
  "from": {"email": "[email removed]"},
  "subject": "Welcome!",
  "content": [{
    "type": "text/html",
    "value": "<h1>Welcome!</h1>"
  }]
}

Send with template

POST https://api.sendgrid.com/v3/mail/send

{
  "personalizations": [{
    "to": [{"email": "[email removed]"}],
    "dynamic_template_data": {
      "name": "John",
      "order_id": "12345"
    }
  }],
  "from": {"email": "[email removed]"},
  "template_id": "d-xxx"
}

Add contact to list

PUT https://api.sendgrid.com/v3/marketing/contacts

{
  "list_ids": ["list-id"],
  "contacts": [{
    "email": "[email removed]",
    "first_name": "John",
    "last_name": "Doe"
  }]
}

Search contacts

POST https://api.sendgrid.com/v3/marketing/contacts/search

{
  "query": "email LIKE 'user@%'"
}

Read marketing campaigns (Single Sends)

The CLI's campaigns list and campaigns get <id> commands read Marketing Single Sends:

GET https://api.sendgrid.com/v3/marketing/singlesends?page_size=25
GET https://api.sendgrid.com/v3/marketing/singlesends/{single_send_id}

List responses contain result and _metadata; get responses contain the Single Send object. The CLI prints these provider responses without reshaping them. These commands use the current Marketing API, which is also used by the contact commands. Legacy Marketing Campaigns use the separate /v3/campaigns API and are not supported by these commands.

Get email statistics

GET https://api.sendgrid.com/v3/stats?start_date=2024-01-01&end_date=2024-01-31

Authorization: Bearer {api_key}

Get bounces

GET https://api.sendgrid.com/v3/suppression/bounces

Authorization: Bearer {api_key}

Get spam reports

GET https://api.sendgrid.com/v3/suppression/spam_reports

Authorization: Bearer {api_key}

Validate email

POST https://api.sendgrid.com/v3/validations/email

{
  "email": "[email removed]"
}

Webhook Events

EventDescription
processedEmail accepted
deliveredEmail delivered
openEmail opened
clickLink clicked
bounceHard/soft bounce
droppedEmail dropped
spamreportMarked as spam
unsubscribeUnsubscribed

Node.js SDK

const sgMail = require('@sendgrid/mail');
sgMail.setApiKey('SG.xxx');

await sgMail.send({
  to: '[email removed]',
  from: '[email removed]',
  subject: 'Welcome!',
  html: '<h1>Welcome!</h1>'
});

When to Use

  • Transactional email at scale
  • Marketing email campaigns
  • Email validation
  • Deliverability management

Rate Limits

  • Free: 100 emails/day
  • Paid: Varies by plan (up to millions/month)

Relevant Skills

  • emails
  • analytics

Source: https://github.com/coreyhaines31/marketingskills/blob/main/tools/integrations/sendgrid.md

Author: coreyhaines31, Marketing skills. License: MIT.

Shown here with formatting for the web; email addresses removed. Keep the author and license notice when you reuse it.

Related entries

There are more like this in the members library

The Codex library holds 7,009 entries. Members can search all of them by meaning and read every one in full.