Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
twilio avatar

Twilio Verify Send Otp

  • 111 installs
  • 26 repo stars
  • Updated July 29, 2026
  • twilio/ai

twilio-verify-send-otp is an agent skill that implements one-time passcode send and verify flows over Twilio Verify across SMS, voice, email, WhatsApp, and RCS.

About

The twilio-verify-send-otp skill guides developers through Twilio Verify for the full OTP lifecycle: code generation, delivery, expiry, rate limiting, and Fraud Guard protection. It contrasts Verify with rolling your own OTP on the Programmable Messaging API, noting built-in expiry, per-phone rate limits, A2P exemption, and multi-channel delivery via a single channel parameter. Quickstart steps create a reusable Verify Service SID, send verifications, and check submitted codes in Python or Node.js with TWILIO_ACCOUNT_SID, TWILIO_AUTH_TOKEN, and VERIFY_SERVICE_SID. Channel tables cover SMS, voice, email, WhatsApp, and RCS, with WhatsApp requiring a registered production sender and optional automatic SMS fallback through channel_configuration. TOTP authenticator flows are handled separately via the Verify Factors API. Prerequisites reference twilio-account-setup and twilio-iam-auth-setup for credentials. Use when adding phone or email verification, two-factor authentication, or multi-channel OTP with managed fraud controls instead of custom messaging infrastructure.

  • Compares Twilio Verify vs Programmable Messaging for OTP generation, rate limits, and fraud controls.
  • Three-step quickstart: create service, send verification, check code in Python or Node.js.
  • Supports SMS, voice, email, WhatsApp, and RCS through one channel parameter.
  • Documents WhatsApp-to-SMS fallback via channel_configuration when WhatsApp is undelivered.
  • Notes TOTP authenticator support lives in the separate Verify Factors API.

Twilio Verify Send Otp by the numbers

  • 111 all-time installs (skills.sh)
  • +7 installs in the week ending Aug 5, 2026 (Skillselion tracking)
  • Ranked #2,929 of 4,347 Backend & APIs skills by installs in the Skillselion catalog
  • Data as of Aug 5, 2026 (Skillselion catalog sync)
At a glance

twilio-verify-send-otp capabilities & compatibility

Capabilities
verify service creation and reuse · multi channel otp send and check · whatsapp automatic sms fallback configuration · python and node.js sdk quickstarts · verify vs programmable messaging decision guidan
Works with
aws
Use cases
api development · security audit
Pricing
Bring your own API key
From the docs

What twilio-verify-send-otp says it does

For standard OTP/2FA flows, use Verify.
SKILL.md
npx skills add https://github.com/twilio/ai --skill twilio-verify-send-otp

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs111
repo stars26
Last updatedJuly 29, 2026
Repositorytwilio/ai

How do I add phone or email OTP verification and 2FA without building code generation, expiry, and rate limiting myself?

Add SMS, voice, email, WhatsApp, or RCS one-time passcode verification and 2FA using Twilio Verify services and SDK quickstarts.

Who is it for?

Developers adding standard OTP or 2FA flows who want Twilio-managed codes, expiry, and fraud protection.

Skip if: Skip when you need fully custom message content and SMS Pumping Protection via Programmable Messaging instead of Verify.

When should I use this skill?

User asks to send or verify OTP codes, add 2FA, or integrate Twilio Verify across SMS, WhatsApp, voice, or email.

What you get

A working Verify Service with send and check endpoints, channel selection, and optional WhatsApp SMS fallback.

Files

SKILL.mdMarkdownGitHub ↗

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 VerifyProgrammable Messaging API
Code generation + expiryBuilt-in (10min default, configurable). Also supports custom codes.Build yourself
Rate limitingBuilt-in (per-phone, per-service)Build yourself
Fraud protectionFraud Guard (geo-permissions, rate anomaly)SMS Pumping Protection
A2P registrationExempt — no 10DLC neededRequired — must register campaign
Multi-channelOne API, change channel param (SMS/Voice/Email/WhatsApp/RCS)Separate integration per channel
CostPer confirmed verification + channel feePer-message pricing + build cost
Delivery confirmationYes — via List Attempts or Events APIYes (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, WhatsApp, and RCS — only the channel parameter changes per delivery method. 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

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

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

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

print(verification.status)  # pending

Node.js

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

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

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

Channelchannel valueNotes
SMSsmsDefault, widest coverage
Voice callvoiceReads code aloud
EmailemailUse email address in to
WhatsAppwhatsappRequires own WhatsApp sender (see below)
RCSrcsRich messaging, Android devices
TOTP (authenticator apps): Supported via the Verify Factors API — a separate implementation from channel-based OTP. See Verify TOTP docs.

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

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

Node.js

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

WhatsApp with Automatic SMS Fallback

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

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

service = client.verify.v2.services.create(
    friendly_name="My App",
    code_length=6,              # 4–10 digits (default: 6)
    lookup_enabled=True,        # Validate number before sending
    do_force_check_once=True,   # Code can only be checked once
    ttl=600,                    # Code expiry in seconds (default: 600)
)

Node.js

const service = await client.verify.v2.services.create({
    friendlyName: "My App",
    codeLength: 6,
    lookupEnabled: true,
    doForceCheckOnce: true,
    ttl: 600,
});

Verification Status Values

StatusMeaning
approvedCode is correct
pendingCode is wrong or not yet submitted
expiredCode has expired (default TTL: 10 minutes)
canceledVerification 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

CodeMeaningFix
60200Invalid parameterCheck to format and channel value
60202Max send attempts reachedWait before retrying
60203Max check attempts reachedIssue a new verification
60212Service not foundVerify VERIFY_SERVICE_SID is correct
60410Geo-permission not enabledEnable 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 60203)
  • 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.
  • Cannot change channel mid-verification — Starting on a new channel reuses the same Verification SID and token. Create a new verification instead.
  • Cannot extend TTL on an existing verification — Default 10 minutes. Customizable only at Service level, not per-verification.
  • 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 configurationchannel: '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 5+ consecutive digits — Service names containing 5+ digits trigger error 60200. Use words or fewer digits.
  • 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

Related skills

FAQ

What channels does twilio-verify-send-otp support?

SMS, voice, email, WhatsApp, and RCS via the channel parameter; TOTP uses the separate Factors API.

When should I use twilio-verify-send-otp?

When adding managed OTP or 2FA with built-in expiry, rate limiting, and Fraud Guard instead of custom messaging code.

Is twilio-verify-send-otp safe to install?

Review the Security Audits panel on this page before installing in production.

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.