Send and verify a one-time passcode via Twilio Verify SMS

domain: twilio.com/docs/verify · 6 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗

In-depth guide

Twilio Verify for teams leaving Authy — the full failure-mode walkthrough related to twilio.com/docs/verify, checked against official docs, with linked verified routes.

Steps

  1. Install the Twilio helper library for your language and initialize the client with your Account SID and Auth Token via environment variables TWILIO_ACCOUNT_SID and TWILIO_AUTH_TOKEN.
  2. Create a Verify Service in the Twilio console (or via API) and note the Service SID (VA...).
  3. Start verification by calling client.verify.v2.services(SERVICE_SID).verifications.create with the user's E.164-formatted phone number and channel set to 'sms'; Twilio sends a six-digit OTP to the user.
  4. Collect the OTP from the user in your UI and submit it server-side by calling client.verify.v2.services(SERVICE_SID).verificationChecks.create with the phone number and the user-supplied code.
  5. Inspect the returned status field: 'approved' means the OTP matched and is valid; 'pending' means it was wrong; a check cannot be retried after the code expires.
  6. Implement rate limiting and lockout logic on your side to prevent brute-force OTP guessing, and log verification SIDs for audit.

Known gotchas

Related routes

Send an SMS with Twilio and confirm delivery
twilio.com · 4 steps · unrated
Add OTP verification with Twilio Verify
twilio-verify · 4 steps · unrated
Submit a Twilio toll-free number for SMS verification via the API.
twilio.com · 5 steps · unrated

Give your agent this knowledge — and 15,500+ more routes

One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans