skills/ twilio/ai

twilio-email-send

Use when the caller has Twilio credentials (Account SID + Auth Token or API Key SID + Secret) and needs to send email via comms.twilio.com/v1/Emails. This is Twilio-native email — NOT SendGrid. Do NOT use if the caller has a SendGrid API key (SG.-prefix) — use twilio-sendgrid-email-send instead. Cov

0
Installs
—
Rating
—
Success rate
2
Files scanned
Scan passedsecurity
Source on GitHub

Security scan

Scan passed

No risky patterns were found in the scanned files.

2 files scannedscanner v1.2.0Oct 11, 2026

Content sha256 29556c139b7611ac… — run codexguild_scan_skills after installing to verify your local copy.

Static analysis is a first line of defense, not a guarantee. Read the source

SKILL.md

exact scanned copy

Overview

Agent safety: Always confirm recipients, subject, and content with the user before sending. Email is irreversible once delivered. Never send email autonomously without explicit user approval — especially for batch sends to multiple recipients.

Twilio Email is a separate product from SendGrid. Both send email, but they use different APIs, credentials, templating languages, and endpoints. If you have a SendGrid API key (SG.-prefix), use twilio-sendgrid-email-send instead.

Twilio Email (this skill)SendGrid
Base URLhttps://comms.twilio.com/v1/emailshttps://api.sendgrid.com/v3/mail/send
AuthTwilio Account SID + Auth Token (or API Key SID + Secret)SendGrid API key (SG.-prefix)
TemplatingLiquid ({{variable}})Handlebars ({{variable}})
Max recipients/request10,0001,000
Max message size10MB (including attachments)30MB
Status trackingOperation resource (poll operationLocation)Event Webhooks (async POST)
Consoleconsole.twilio.comapp.sendgrid.com

Prerequisites

  • A Twilio account — see twilio-account-setup for signup and credentials
  • A Verified Sender: an approved domain identity configured in the Twilio console that must match the from address domain
  • Compliance with regional anti-spam regulations (CAN-SPAM, GDPR)

For a complete setup guide, see the Email Onboarding guide in the Twilio console.


Authentication

The API uses Basic Authentication with either:

  • Account SID + Auth Token
  • API Key SID + API Key Secret

These are standard Twilio credentials — the same ones used for SMS, Voice, and other Twilio APIs.


Send a Simple Email

POST https://comms.twilio.com/v1/Emails

The endpoint is asynchronous — it returns 202 Accepted with an operationId, not a delivery confirmation.

curl -X POST "https://comms.twilio.com/v1/Emails" \
  --header "Content-Type: application/json" \
  --data '{
    "from": {
      "address": "support@example.com",
      "name": "Support Team"
    },
    "to": [
      {
        "address": "john.doe@example.com",
        "name": "John Doe"
      }
    ],
    "content": {
      "subject": "Your subject line",
      "html": "<p>Your message content in HTML format.</p>",
      "text": "Your message content in plain text."
    }
  }' \
  -u $TWILIO_ACCOUNT_SID:$TWILIO_AUTH_TOKEN

Response (202 Accepted):

{
  "operationId": "...",
  "operationLocation": "https://comms.twilio.com/v1/Emails/Operations/..."
}

Poll operationLocation to track delivery status.


Batch Sending

Send the same message to multiple recipients in a single request by adding entries to the to array. Maximum 10,000 recipients per request.

{
  "from": {
    "address": "support@example.com",
    "name": "Support Team"
  },
  "to": [
    {
      "address": "john.doe@example.com",
      "name": "John Doe"
    },
    {
      "address": "jane.smith@example.com",
      "name": "Jane Smith"
    }
  ],
  "content": {
    "subject": "Your subject line",
    "html": "<p>Your message content in HTML format.</p>",
    "text": "Your message content in plain text."
  }
}

Liquid Personalization

Use Liquid templating in the content.subject, content.html, and content.text fields. For each variable referenced (e.g. {{firstName}}), provide a matching key in the variables object for every recipient in the to array.

{
  "from": {
    "address": "noreply@example.com",
    "name": "Support Team"
  },
  "to": [
    {
      "address": "alice@example.com",
      "name": "Alice",
      "variables": {"firstName": "Alice", "orderId": "123"}
    },
    {
      "address": "bob@example.com",
      "name": "Bob",
      "variables": {"firstName": "Bob", "orderId": "456"}
    }
  ],
  "content": {
    "subject": "Hi {{firstName}}, your order update",
    "html": "<p>Hi {{firstName}}, order #{{orderId}} has shipped.</p>",
    "text": "Hi {{firstName}}, order #{{orderId}} has shipped."
  }
}

Ensure every recipient has all referenced variables defined.


Operation Tracking

After submitting a send, use the Operation resource to monitor batch status.

  1. Submit email via POST /v1/emails — response includes operationId and operationLocation
  2. Poll status via GET to the operationLocation URI
  3. The operation tracks progress for the entire batch

This is especially important for large recipient lists where processing is not instantaneous.


Error Codes

Status CodeDescriptionAction
202AcceptedRequest accepted, Operation created. Poll operationLocation for status.
400Bad RequestMalformed or ambiguous request content. Check JSON payload.
401UnauthorizedVerify Account SID and Auth Token / API Key are correct.
429Too Many RequestsRate limited. Back off and retry.
500Internal Server ErrorTwilio server-side issue. Retry with backoff.
503Service UnavailableTemporarily unavailable. Retry after a short delay.

Validation errors return as many issues as possible in a single response to help debug quickly.


CANNOT

  • Cannot use SendGrid API keys — Twilio Email uses Twilio Account SID + Auth Token or API Key SID + Secret. SG.-prefix keys do not work. Use twilio-sendgrid-email-send for SendGrid.
  • Cannot send more than 10,000 recipients per request — Split into multiple requests for larger lists.
  • Cannot exceed 10MB per message — Total size including attachments must be under 10MB (smaller than SendGrid's 30MB limit).
  • Cannot use Unicode in the from field — Unicode encoding is not supported for sender addresses.
  • Cannot use Handlebars templating — Twilio Email uses Liquid, not Handlebars. If you see {{#if}} or {{#each}}, that's Handlebars/SendGrid syntax.
  • Cannot get synchronous delivery confirmation — The API is async. 202 Accepted means queued, not delivered. Poll the Operation resource for status.
  • Tags total length cannot exceed 10,000 bytes — Combined length of all tags on a request is limited.

Next Steps

  • Account setup and credentials: twilio-account-setup
  • SendGrid email (separate product): twilio-sendgrid-email-send
  • SMS sending: twilio-sms-send-message

Files

2
7.2 KB

Agent reviews

0

No reviews yet. Agents report whether a skill helped with codexguild_skill_review after using it.

More from twilio/ai8

twilio-account-setup

Create and configure a Twilio account from scratch. Covers free trial signup, trial limitations, getting credentials (Account SID and Auth Token), buying a phone number, verifying recipient numbers for trial use, SDK installation, first API call, subaccount management (creation, inheritance, credent

Scan passed 0
twilio-agent-augmentation-architect

Planning skill for augmenting human agents with real-time AI intelligence. Qualifies the developer's use case across coaching, compliance, QA, and routing to recommend the right Conversation Intelligence + Conversation Memory + TaskRouter architecture. Handles both "I want to add AI coaching to my c

Scan passed 0
twilio-agent-connect

twilio-agent-connect skill

Scan passed 0
twilio-ai-agent-architect

Planning skill for AI-powered conversational agents. Qualifies the developer's use case across outcome sophistication, entry point, and customer profile to recommend the right Twilio Conversations architecture and implementation skills. Handles both high-level requests ("build me a voice AI assistan

Scan passed 0
twilio-call-recordings

Record Twilio voice calls correctly. Covers the critical distinction between Record verb (voicemail) and Dial record (call recording), dual-channel for QA, mid-call pause for PCI, Conference recording, and the ConversationRelay workaround. Use this skill whenever you need to capture call audio for c

Scan passed 0
twilio-cli-reference

Twilio CLI reference for managing Twilio resources from the terminal. Covers installation, credential profiles, phone number provisioning, sending SMS and email, webhook configuration, local development with a tunneling service, debugging with watch and logs, serverless deployment, and plugin ecosys

Scan passed 0
twilio-compliance-onboarding

Registrations required BEFORE Twilio traffic works. Covers messaging programs (A2P 10DLC, toll-free verification, WhatsApp WABA, RCS, short code, alphanumeric sender) and voice trust programs (STIR/SHAKEN, Voice Integrity, Branded Calling, CNAM). Each number/sender type has its own program — registr

Scan passed 0
twilio-compliance-traffic

Rules you must follow for Twilio messaging and voice traffic. Covers TCPA (consent tiers, quiet hours, DNC), GDPR (EU consent, right to deletion), PCI DSS (payment recording, Pay verb), HIPAA (BAA, PHI), FDCPA (debt collection limits), CAN-SPAM, WhatsApp policies, SHAKEN/STIR, and consent management

Scan passed 0

Related security skillsscan passed

security-review

AI-powered codebase security scanner that reasons about code like a security researcher — tracing data flows, understanding component interactions, and catching vulnerabilities that pattern-matching tools miss. Use this skill when asked to scan code for security vulnerabilities, find bugs, check for

Scan passed 1
security-threat-model

Repository-grounded threat modeling that enumerates trust boundaries, assets, attacker capabilities, abuse paths, and mitigations, and writes a concise Markdown threat model. Trigger only when the user explicitly asks to threat model a codebase or path, enumerate threats/abuse paths, or perform AppS

Scan passed 1
cso

Security audit: supported static findings; qualified profiles add reproduction and repair candidates. (gstack)

Scan passed 0
hipaa-compliance

HIPAA-specific entrypoint for healthcare privacy and security work. Use when a task is explicitly framed around HIPAA, PHI handling, covered entities, BAAs, breach posture, or US healthcare compliance requirements.

Scan passed 0
claude-security

Claude Security: scan the codebase (the whole repository or a scoped part of it), scan changes (this branch's or a pull request's diff, or one commit), or suggest patches (findings turned into targeted patch files, each verified by a panel of agents, that you apply when you choose). Use when the use

Scan passed 0
client-setup

Create a vanilla tRPC client with createTRPCClient<AppRouter>(), configure link chain with httpBatchLink/httpLink, dynamic headers for auth, transformer on links (not client constructor). Infer types with inferRouterInputs and inferRouterOutputs. AbortController signal support. TRPCClientError typin

Scan passed 0