Agent Native

twilio-verify-send-otp

Send and verify one-time passcodes via Twilio Verify over SMS, voice, email, or WhatsApp, with automatic code generation, expiry, rate limiting, and fraud…

by TwilioOfficial publisherNot reviewed

Identity proven by GitHub's verified organisation badge (twilio)

Agents
Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode, claude.ai and API
License
MIT (permissive)
Pin
8aba46fpinned Oct 9, 2026
Context cost
about 2,600 tokenswhen the skill loads
GitHub stars
37on twilio/ai
Scripts
None found

What it does

“Send and verify one-time passcodes (OTPs) via Twilio Verify over SMS (auto-upgraded to RCS where supported), voice, email, or WhatsApp. Covers creating a Verify Service, sending tokens, checking submitted codes, automatic WhatsApp-to-SMS fallback, and service configuration. TOTP is supported via the Factors API (a separate family from channel-based OTP). Use this skill to add phone or email verification or two-factor authentication to any application.”
The author's description, from SKILL.md

Generated summary from the skill's own text

Send and verify one-time passcodes via Twilio Verify over SMS, voice, email, or WhatsApp, with automatic code generation, expiry, rate limiting, and fraud protection built in. The skill covers the full OTP lifecycle from service creation through verification checks, supporting multi-channel delivery and WhatsApp-to-SMS fallback. Use it to add phone or email verification and two-factor authentication to applications.

When to use it

  • Building phone or email verification flows into web or mobile apps
  • Implementing two-factor authentication with multiple delivery channels
  • Needing automatic code generation, expiry, and rate limiting without custom logic
  • Supporting international users across SMS, voice, email, and WhatsApp

When not to

  • Requiring full control over OTP message content or custom delivery logic
  • Need to send custom OTP messages via SMS with your own infrastructure
  • Building TOTP authenticator app support instead of channel-based OTP

Install

These commands install from the publisher's repository and need no account.

skills CLI

npx skills add twilio/ai --skill twilio-verify-send-otp

Installs from the repository's default branch, which may have changed since the commit we checked.

GitHub CLI 2.90 or later

gh skill install twilio/ai twilio-verify-send-otp@8aba46fb65dc8d9a20f4b301a68352064b4159a5

Installs the commit we checked (8aba46f).

Copy by hand

Download the folder at 8aba46f and put it in .claude/skills/twilio-verify-send-otp for Claude Code and in .agents/skills/twilio-verify-send-otp for Codex, Cursor, Gemini CLI, GitHub Copilot and OpenCode.

Skill folder on GitHub at 8aba46f

Claude Code plugin

/plugin install twilio-developer-kit@claude-plugins-official

The publisher's plugin in Claude's official marketplace. It may hold more than this skill, and we have not pinned it.

Copy for your agent

A prompt for any coding agent. It installs this skill from GitHub at the pinned commit, copies the files as they are, and runs nothing unless you ask.

Prompt

Install the agent skill "twilio-verify-send-otp" by Twilio.

Source, pinned to commit 8aba46fb65dc8d9a20f4b301a68352064b4159a5:
https://github.com/twilio/ai/tree/8aba46fb65dc8d9a20f4b301a68352064b4159a5/skills/twilio/twilio-verify-send-otp

1. Download that folder at exactly this commit. Do not use the default branch.
2. Copy every file unchanged, keeping the folder structure, into .claude/skills/twilio-verify-send-otp/ for Claude Code and .agents/skills/twilio-verify-send-otp/ for Codex, Cursor, Gemini CLI, GitHub Copilot and OpenCode. Create the folders if they do not exist.
3. Do not edit the files, and do not run any script in the folder unless I ask you to.
4. When you are done, list the files you copied and where you put them.

Listing and checks: https://www.agentnative.dev/skills/twilio/twilio-verify-send-otp

SKILL.md at the pin

---
name: twilio-verify-send-otp
description: >
  Send and verify one-time passcodes (OTPs) via Twilio Verify over SMS
  (auto-upgraded to RCS where supported), voice, email, or WhatsApp. Covers
  creating a Verify Service, sending tokens,
  checking submitted codes, automatic WhatsApp-to-SMS fallback, and service
  configuration. TOTP is supported via the Factors API (a separate family from
  channel-based OTP). Use this skill to add phone or email verification or
  two-factor authentication to any application.
---

## Overview

Use **Twilio Verify** to manage the full OTP lifecycle: code generation, delivery, expiry, rate limiting, and Fraud Guard protection. Use the **Programmable Messaging API** to build your own OTP message infrastructure and access features such as SMS Pumping Protection.

| | Twilio Verify | Programmable Messaging API |
|---|---|---|
| Code generation + expiry | Built-in (10min default, configurable). Also supports custom codes. | Build yourself |
| Rate limiting | Built-in (per-phone, per-service) | Build yourself |
| Fraud protection | Fraud Guard (geo-permissions, rate anomaly) | SMS Pumping Protection |
| A2P registration | Exempt — no 10DLC needed | Required — must register campaign |
| Multi-channel | One API, change `channel` param (SMS/Voice/Email/WhatsApp) | Separate integration per channel |
| Cost | [Per confirmed verification + channel fee](https://www.twilio.com/en-us/verify/pricing) | Per-message pricing + build cost |
| Delivery confirmation | Yes — via List Attempts or Events API | Yes (via StatusCallback) |

**When Programmable Messaging is justified:** You need full control over message content, custom delivery logic, or SMS Pumping Protection features. For standard OTP/2FA flows, use Verify.

Verify supports SMS, voice, email, and WhatsApp — only the `channel` parameter changes per delivery method. RCS is not a `channel` value: Verify automatically upgrades an `sms` verification to RCS where the device supports it and falls back to SMS. TOTP (authenticator apps) is supported via the Verify Factors API, a separate implementation from channel-based OTP.

---

## Prerequisites

- Twilio account (free trial works for testing)
  — New to Twilio? See `twilio-account-setup`
  — Verify requires no separate product activation — just create a Service below
- Environment variables:
  - `TWILIO_ACCOUNT_SID`
  - `TWILIO_AUTH_TOKEN`
  - `VERIFY_SERVICE_SID` (created in Quickstart step 1)
  — See `twilio-iam-auth-setup` for credential setup and best practices
- SDK: `pip install twilio` / `npm install twilio`
- For WhatsApp channel only: a registered production WhatsApp sender — see `twilio-whatsapp-manage-senders`

---

## Quickstart

**Step 1 — Create a Verify Service (one-time)**

**Python**
```python
import os
from twilio.rest import Client

client = Client(os.environ["TWILIO_ACCOUNT_SID"], os.environ["TWILIO_AUTH_TOKEN"])

service = client.verify.v2.services.create(
    friendly_name="My App Verification"
)
print(service.sid)  # VAxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx — save as VERIFY_SERVICE_SID
```

**Node.js**
```node
const twilio = require("twilio");
const client = twilio(process.env.TWILIO_ACCOUNT_SID, process.env.TWILIO_AUTH_TOKEN);

const service = await client.verify.v2.services.create({
    friendlyName: "My App Verification",
});
console.log(service.sid);  // VAxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
```

Store the Service SID — reuse it for all verifications, do not recreate it each time.

**Step 2 — Send a verification token**

**Python**
```python
verification = client.verify.v2 \
    .services(os.environ["VERIFY_SERVICE_SID"]) \
    .verifications \
    .create(to="+15558675310", channel="sms")

print(verification.status)  # pending
```

**Node.js**
```node
const verification = await client.verify.v2
    .services(process.env.VERIFY_SERVICE_SID)
    .verifications.create({ to: "+15558675310", channel: "sms" });

console.log(verification.status);  // pending
```

**Step 3 — Check the submitted code**

**Python**
```python
check = client.verify.v2 \
    .services(os.environ["VERIFY_SERVICE_SID"]) \
    .verification_checks \
    .create(to="+15558675310", code="123456")

if check.status == "approved":
    print("Verified!")
else:
    print("Invalid or expired code")
```

**Node.js**
```node
const check = await client.verify.v2
    .services(process.env.VERIFY_SERVICE_SID)
    .verificationChecks.create({ to: "+15558675310", code: "123456" });

if (check.status === "approved") {
    console.log("Verified!");
} else {
    console.log("Invalid or expired code");
}
```

---

## Key Patterns

### Supported Channels

| Channel | `channel` value | Notes |
|---------|----------------|-------|
| SMS | `sms` | Default, widest coverage. Auto-upgrades to RCS where supported (see below) |
| Voice call | `call` | Reads code aloud |
| Email | `email` | Use email address in `to` |
| WhatsApp | `whatsapp` | Requires own WhatsApp sender (see below) |

> **TOTP (authenticator apps):** Supported via the Verify Factors API — a separate implementation from channel-based OTP. See [Verify TOTP docs](https://www.twilio.com/docs/verify/quickstarts/totp).

### WhatsApp OTP

Change `channel` to `"whatsapp"` — the send/check flow is identical to SMS.

> **Requires:** A registered production WhatsApp sender. As of March 2024, Twilio no longer provides a shared sender for Verify. See `twilio-whatsapp-manage-senders`.

**Python**
```python
verification = client.verify.v2 \
    .services(os.environ["VERIFY_SERVICE_SID"]) \
    .verifications \
    .create(to="+15558675310", channel="whatsapp")
```

**Node.js**
```node
const verification = await client.verify.v2
    .services(process.env.VERIFY_SERVICE_SID)
    .verifications.create({ to: "+15558675310", channel: "whatsapp" });
```

### WhatsApp with Automatic SMS Fallback

**Python**
```python
verification = client.verify.v2 \
    .services(os.environ["VERIFY_SERVICE_SID"]) \
    .verifications \
    .create(
        to="+15558675310",
        channel="whatsapp",
        channel_configuration={
            "whatsapp": {"enabled": True},
            "sms": {"enabled": True}   # falls back to SMS if WhatsApp undelivered
        }
    )
```

**Node.js**
```node
const verification = await client.verify.v2
    .services(process.env.VERIFY_SERVICE_SID)
    .verifications.create({
        to: "+15558675310",
        channel: "whatsapp",
        channelConfiguration: {
            whatsapp: { enabled: true },
            sms: { enabled: true },
        },
    });
```

With fallback enabled, your UI can say "a verification code was sent" without specifying the channel.

### Service Configuration

**Python**
```python
service = client.verify.v2.services.create(
    friendly_name="My App",
    code_length=6              # 4–10 digits (default: 6)
)
```

**Node.js**
```node
const service = await client.verify.v2.services.create({
    friendlyName: "My App",
    codeLength: 6
});
```

### Verification Status Values

| Status | Meaning |
|--------|---------|
| `approved` | Code is correct |
| `pending` | Code is wrong or not yet submitted |
| `expired` | Code has expired (default TTL: 10 minutes) |
| `canceled` | Verification was canceled |

---

## Debugging

**Primary debugging tool:** Console > Verify > Logs (per-Service). Shows every verification attempt, delivery status, channel used, and error codes. Check here first before writing custom monitoring code.

### Common Errors

| Code | Meaning | Fix |
|------|---------|-----|
| 60200 | Invalid parameter | Check `to` format and `channel` value |
| 60202 | Max check attempts reached | Issue a new verification |
| 60203 | Max send attempts reached | Wait before retrying |
| 60212 | Service not found | Verify `VERIFY_SERVICE_SID` is correct |
| 60410 | Geo-permission not enabled | Enable country in Console |

**Built-in protections (no custom code needed):**
- Rate limiting: 5 verifications per phone per service per 10 minutes
- Max check attempts: 5 per verification (6th attempt → error 60202)
- Phone number validation: Verify checks line type before sending (if `lookup_enabled=True`)
- Fraud Guard: geo-permissions, rate anomaly detection, SMS pumping protection

**International OTP traffic warning:** International numbers are high-risk for SMS pumping — fraudsters trigger OTPs to premium-rate destinations to generate revenue. Verify's Fraud Guard handles this automatically when enabled. If you're building custom OTP with Programmable Messaging instead, enable SMS Pumping Protection on your Messaging Service (see `twilio-messaging-services`). Always restrict geo-permissions to only countries where you have real users.

---

## CANNOT

- **No built-in channel fallback** — Must implement retry logic manually (e.g., SMS → voice → email). Use `channel_configuration` for WhatsApp→SMS only.
- **No webhook on verification completion** — Must poll `verification_checks`. Rate-limited: 60/min, 180/hr, 250/day.
- **Cannot retrieve the actual code sent** — Code is never returned in any API response. By design.
- **Sending on a new channel with the same `to` reuses the pending verification** — the same Verification SID and code are kept, just delivered over the new channel (e.g. switching `sms` → `call` for the same phone number). A different `to` (e.g. an email address) starts a separate verification. To force a fresh code on the same `to`, cancel the pending one first.
- **Cannot extend TTL on an existing verification** — Default 10 minutes, and not a per-verification or Service create/update param. Contact Twilio Support to change the default on your Service (adjustable 2 min–24 hr).
- **Verification SID deleted after approval** — Fetching an approved verification returns 404. Canceled verifications remain fetchable.
- **`auto` channel not universally available** — Returns error 60200 on accounts without Fraud Guard enabled.
- **Email channel requires Mailer configuration** — `channel: 'email'` without a configured Mailer returns error 60217.
- **No real-time delivery push notification** — Delivery status is available via List Attempts or Events API (pull-based), not via a push webhook.
- **FriendlyName rejects embedded digit strings** — avoid embedding 5 or more digits in a Service name; it can trigger error 60200. Use words.
- **Wrong code does not throw an exception** — Check returns `status: "pending"`, not an error. You must check `status === "approved"` explicitly.
- **Cannot re-check an approved verification** — Each verification is single-use. Once `approved`, subsequent checks return 404.
- **Cannot send to arbitrary numbers on trial accounts** — Trial accounts have limited verification destinations
- **Cannot customize WhatsApp OTP template** — Uses a fixed Meta authentication template
- **Cannot use WhatsApp channel for PSD2 compliance mode** — PSD2 payee/amount parameters not supported on WhatsApp

---

## Next Steps

- **Register a WhatsApp sender:** `twilio-whatsapp-manage-senders`
- **Validate phone numbers before sending:** `twilio-lookup-phone-intelligence`
- **Credential setup:** `twilio-iam-auth-setup`

From twilio/ai at 8aba46f, shown as plain text under its license: MIT (permissive). The license text is in LICENSE.

View SKILL.md on GitHub at 8aba46f

Files

4 files, 27 KB in total. Each file has a sha256 in the pin's manifest; the first 12 characters are shown.

Skill folder on GitHub at 8aba46f
All 50 skills from Twilio

More from Twilio

  • twilio-account-setup

    Sets up a Twilio account from scratch, including free trial signup, credential retrieval, phone number purchase, and enabling specific products like AI…

    Claude Code, Codex, Cursor +4 · about 2.5K tokens · pinned 6 days ago

  • twilio-agent-augmentation-architect

    This skill helps developers design AI-augmented contact center systems that enhance human agents with real-time intelligence.

    Claude Code, Codex, Cursor +3 · about 3.6K tokens · pinned 6 days ago

  • twilio-agent-connect

    Twilio Agent Connect is middleware that integrates LLM agents with Twilio communication channels (voice, SMS, RCS, WhatsApp, chat).

    Claude Code, Codex, Cursor +4 · about 4.1K tokens · pinned 6 days ago

  • twilio-ai-agent-architect

    Planning skill that helps developers design AI-powered conversational agents by assessing their use case across outcome sophistication, channels, and customer…

    Claude Code, Codex, Cursor +3 · about 4.9K tokens · pinned 6 days ago

  • twilio-call-recordings

    This skill teaches agents to record Twilio voice calls correctly using the appropriate method for the use case.

    Claude Code, Codex, Cursor +4 · about 2.6K tokens · pinned 6 days ago

  • twilio-cli-reference

    The Twilio CLI reference enables agents to manage Twilio resources directly from the terminal, including phone number provisioning, sending SMS and email…

    Claude Code, Codex, Cursor +4 · about 1.8K tokens · pinned 6 days ago

All Backend and APIs skills
  • twilio-conference-calls

    This skill enables multi-party call handling using Twilio Conference, covering warm and cold transfers, hold versus mute, supervisor coaching with whisper…

    by TwilioOfficial publisher

    Claude Code, Codex, Cursor +4 · about 2.8K tokens · pinned 6 days ago

  • twilio-content-template-builder

    This skill enables agents to create, manage, and send message templates through Twilio's Content API across WhatsApp, SMS, RCS, and MMS channels.

    by TwilioOfficial publisher

    Claude Code, Codex, Cursor +4 · about 1.3K tokens · pinned 6 days ago

  • twilio-conversation-orchestrator

    This skill configures Twilio Conversation Orchestrator to automatically capture and route SMS, voice, WhatsApp, RCS, and web chat into unified conversations.

    by TwilioOfficial publisher

    Claude Code, Codex, Cursor +4 · about 8.3K tokens · pinned 6 days ago

  • twilio-conversations-classic-api

    Build multi-channel messaging conversations using Twilio's classic API, combining SMS, WhatsApp, and web chat participants in persistent threads with message…

    by TwilioOfficial publisher

    Claude Code, Codex, Cursor +4 · about 4.2K tokens · pinned 6 days ago

  • twilio-iam-auth-setup

    This skill guides agents through setting up Twilio authentication methods including Auth Tokens, API Keys (Standard, Main, Restricted), Access Tokens for…

    by TwilioOfficial publisher

    Claude Code, Codex, Cursor +4 · about 2.3K tokens · pinned 6 days ago

  • twilio-isv-sms-best-practices

    This skill guides ISVs building multi-tenant SMS platforms on Twilio through subaccount architecture, customer onboarding for A2P 10DLC and toll-free…

    by TwilioOfficial publisher

    Claude Code, Codex, Cursor +4 · about 2.7K tokens · pinned 6 days ago

The skills listed here are third-party software, collected from public GitHub repositories as a catalog of recent skills and provided as is. Agent Native does not write or control them and is not responsible for any harm, loss or damage caused by installing or using them. Labels and checks describe what we saw at one commit and are not a guarantee. Read a skill's files before you run it. Terms of use