twilio-sendgrid-suppressions — Codex skill: features and install
This skill helps investigate SendGrid suppressions and manage category-based unsubscribes. Use it when diagnosing delivery problems or building unsubscribe flows.
npx skills add openai/plugins --skill twilio-sendgrid-suppressions -a codexWhat twilio-sendgrid-suppressions does
The skill covers suppressions caused by hard and soft bounces, blocks, spam complaints, invalid addresses, and unsubscribes. It describes checking and removing records through the API, plus using ASM groups to separate unsubscribe categories. API access requires a SendGrid key with the SG- prefix.
Suppressions generally affect all future sends, so deleting a hard-bounce record does not make an invalid mailbox usable. Spam-complaint suppressions cannot be overridden, and records cannot be removed in bulk by domain. Removing a complaint record can expose the sender to reputation damage, so the skill advises confirming removals with the user.
What it helps with
- inspect addresses listed as hard bounces
- trace why SendGrid is suppressing a delivery
- remove a suppression record for one address
- set up ASM groups for category-specific unsubscribes
- understand the risks of automatic bounce and block cleanup
Example prompts for the agent
- Check why
[email protected]is suppressed in SendGrid and explain the reason. - Help me set up ASM groups so people can unsubscribe from marketing mail without leaving every email list.
- Explain the consequences of removing this address's hard-bounce record.
How to install twilio-sendgrid-suppressions
1Skills CLI (Vercel)
npx skills add openai/plugins --skill twilio-sendgrid-suppressions -a codex2Manually: put the files in place
.agents/skills/twilio-sendgrid-suppressions/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add openai/plugins --skill twilio-sendgrid-suppressions -a claude-code2Manually: put the files in place
~/.claude/skills/twilio-sendgrid-suppressions/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/twilio-sendgrid-suppressions/
Manually: put the files in place
.cursor/skills/twilio-sendgrid-suppressions/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install openai/plugins twilio-sendgrid-suppressions2Manually: put the files in place
.github/skills/twilio-sendgrid-suppressions/SKILL.mdPlatform CLI
gemini skills install https://github.com/openai/plugins --path plugins/twilio-developer-kit/skills/twilio-sendgrid-suppressionsManually: put the files in place
.devin/skills/twilio-sendgrid-suppressions/SKILL.mdThe legacy .windsurf/skills/ path still works
Claude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: Codex skills: how to install, where they live, how to call them
Questions about twilio-sendgrid-suppressions
How do I install twilio-sendgrid-suppressions in Codex?
Run npx skills add openai/plugins --skill twilio-sendgrid-suppressions -a codex. The skill file is installed at .agents/skills/twilio-sendgrid-suppressions/SKILL.md.
What does twilio-sendgrid-suppressions do?
It helps inspect and manage SendGrid suppression records, and explains how to use ASM groups for category-based unsubscribes.
What do I need to access the SendGrid API?
You need a SendGrid API key beginning with SG-. This skill does not apply to the Twilio Email API.
Source text
SKILL.md · MIT
---
name: twilio-sendgrid-suppressions
description: >
Manage SendGrid email suppressions: bounces, blocks, spam reports,
invalid emails, global unsubscribes, and ASM suppression groups.
Covers when and how to remove suppressions, reputation impact, and
category-based unsubscribe management. Use when debugging SendGrid
delivery issues or building unsubscribe flows. Requires a SendGrid API
key (SG.-prefix) — not applicable to the Twilio Email API (comms.twilio.com).
---
## Overview
Suppressions prevent SendGrid from sending to addresses that have bounced, reported spam, or unsubscribed. They protect your sender reputation but can also block legitimate re-sends if not managed correctly.
---
## Suppression Types
| Type | Endpoint | What triggers it | Auto-added? |
|------|----------|-----------------|-------------|
| **Hard Bounces** | `/v3/suppression/bounces` | Permanent delivery failure (invalid mailbox, domain doesn't exist) | Yes |
| **Soft Bounces** | No management API — automatic retry only | Temporary failure (mailbox full, server down) — SendGrid auto-retries before suppressing | Yes, after repeated failures |
| **Blocks** | `/v3/suppression/blocks` | Temporary rejection by receiving server (reputation, policy, content) | Yes |
| **Spam Reports** | `/v3/suppression/spam_reports` | Recipient marks email as spam | Yes |
| **Invalid Emails** | `/v3/suppression/invalid_emails` | Malformed email address | Yes |
| **Global Unsubscribes** | `/v3/suppression/unsubscribes` | Recipient unsubscribes from all email | Yes |
| **Group Unsubscribes (ASM)** | `/v3/asm/groups/{id}/suppressions` | Recipient unsubscribes from a category | Yes |
**Hard vs Soft bounces:** Hard bounces (permanent) immediately suppress the address. Soft bounces (temporary) trigger retries — SendGrid will retry delivery before eventually suppressing if the issue persists.
---
## Managing Suppressions
**List bounces (Python)**
```python
import os, requests
headers = {"Authorization": f"Bearer {os.environ['SENDGRID_API_KEY']}"}
response = requests.get("https://api.sendgrid.com/v3/suppression/bounces", headers=headers)
for bounce in response.json():
print(f"{bounce['email']}: {bounce.get('reason', 'unknown')}")
```
**Remove a bounce (Python)**
```python
requests.delete(f"https://api.sendgrid.com/v3/suppression/bounces/{email}", headers=headers)
```
> **Caution:** Deleting suppression records (especially spam reports) allows re-sending to addresses that previously complained. Always confirm with the user before removal and document the business reason.
---
## ASM Suppression Groups
Use suppression groups for category-based unsubscribes (e.g., "Marketing", "Transactional", "Product Updates"). Recipients can unsubscribe from one category without being suppressed from all email.
**Create a group:**
```python
requests.post("https://api.sendgrid.com/v3/asm/groups",
headers={**headers, "Content-Type": "application/json"},
json={"name": "Marketing Emails", "description": "Promotional offers and updates"})
```
**Send with a suppression group:**
Include `asm.group_id` in your Mail Send request. Recipients see a "manage preferences" link instead of a global unsubscribe.
---
## Auto-Purge (Bounce & Block Cleanup)
Configure automatic purge schedules in Console > Settings > Mail Settings > Purge Bounces & Blocks:
- **Soft Bounces:** Auto-purge after N days (1–3,650 days)
- **Hard Bounces:** Auto-purge after N days (1–3,650 days)
**Caution:** Enabling auto-purge without a business reason allows re-sending to previously bounced addresses, which damages sender reputation. Do not use as a workaround to force delivery.
---
## Address Allow List
Console > Settings > Mail Settings > Address Allow List allows specific email addresses or domains to bypass all suppressions. Useful for internal testing addresses.
**Use with extreme caution** — never allowlist domains you don't control (e.g., `gmail.com`), and never use to bypass spam report suppressions.
---
## CANNOT
- **Suppressions are global by default** — A bounce or spam report on ANY email suppresses the address from ALL future sends. Use ASM groups to scope unsubscribes.
- **Removing a suppression does not fix the underlying issue** — Deleting a bounce record lets you retry, but the mailbox is likely still invalid. Re-sending to hard bounces damages sender reputation.
- **Cannot prevent spam report suppressions** — When a recipient marks you as spam, the suppression is automatic and cannot be overridden.
- **Cannot bulk-remove suppressions by domain** — Must remove individually by email address via API.
---
## Next Steps
- **Send email:** `twilio-sendgrid-email-send`
- **Delivery tracking:** `twilio-sendgrid-webhooks`
- **Account setup:** `twilio-sendgrid-account-setup`
© Twilio · MIT · openai/plugins