Twilio Verify (OTP)
Lets an agent send one-time passcodes by SMS, WhatsApp, voice call or email through Twilio Verify, check the code a user enters, and look up or cancel pending verifications. Curated from Twilio's official OpenAPI specification.
Connect this API to an AI agent Browse all specs
What you can do with Twilio Verify (OTP) via MCP
Every endpoint below becomes a governed tool your AI agent (Claude, ChatGPT, or a customer-facing VX agent) can call — with scoped permissions, sandbox testing, and audit logs.
| Method | Path | Operation | Description |
|---|---|---|---|
| GET | /v2/Services |
listVerifyServices | List the Verify services in the account (to find the Service SID) |
| GET | /v2/Services/{Sid} |
getVerifyService | Get a Verify service's settings (name, code length, channels) |
| POST | /v2/Services/{ServiceSid}/Verifications |
sendVerification | Send a one-time code by SMS, WhatsApp, call or email |
| POST | /v2/Services/{ServiceSid}/VerificationCheck |
checkVerification | Check the code the user entered (approved or pending) |
| GET | /v2/Services/{ServiceSid}/Verifications/{Sid} |
getVerification | Get the status of a verification |
| POST | /v2/Services/{ServiceSid}/Verifications/{Sid} |
updateVerification | Cancel a pending verification (or mark it approved) |
Authentication
accountSid_authToken
HTTP Basic
HTTP Basic auth: username = Account SID (AC...), password = Auth Token. An API key works too: username = API Key SID (SK...), password = API key secret.
How to get a credential
- Sign in to the Twilio Console (https://console.twilio.com).
- On the dashboard under Account Info, copy the Account SID and the Auth Token.
- Recommended: create a Standard API key in Account > API keys & tokens and use its SID + secret instead.
- Create a Verify Service in Verify > Services > Create new (set the friendly name shown in the message and the code length). Copy its Service SID (
VA...). - For email or WhatsApp channels, finish the channel setup on the service (email integration / WhatsApp sender) first.
Permissions used
Twilio Basic credentials are account-wide; there are no per-operation scopes.
| Credential | Operations |
|---|---|
| Account SID + Auth Token, or Standard API key | listVerifyServices, getVerifyService, sendVerification, checkVerification, getVerification, updateVerification |
Common errors
- 401 Unauthorized (20003): wrong SID/token pair. Re-copy both values.
- 403 Forbidden: channel disabled on the service, trial account sending to an unverified number, or geo-permissions block the country.
- 400 Bad Request: invalid
To(60200), max send attempts reached (60203), or invalid parameter. Use E.164 numbers like+14155550100. - 404 Not Found on check: the verification expired (10 minutes), was already approved, or was never created (20404).
- 429 Too Many Requests (60202/60203 or 20429): too many attempts or requests; wait before retrying.
Store the SID and token (or API key SID and secret) as a VX Agents credential (Basic auth) for this spec; never paste them into chat.
Usage guide
Setup
- Credential: Basic auth with Account SID + Auth Token, or a Standard API key SID + secret (Twilio Console > Account > API keys & tokens).
- Create a Verify Service once in the Console (Verify > Services) and pin its
ServiceSid(VA...) as a preset. UselistVerifyServicesif you need to find it. - Email and WhatsApp channels need extra setup on the service before they work; SMS and call work out of the box.
Verify a user with a one-time code
sendVerificationwithTo(E.164 phone like+14155550100, or an email address forChannel=email) andChannel=sms,whatsapp,calloremail. OptionalLocale(e.g.es) for the message language.- Tell the user a code is on its way. Keep the returned
sid(VE...). - When the user gives you the code, call
checkVerificationwithTo(orVerificationSid) andCode.status: approved(andvalid: true) = verified.status: pending= wrong code; the user may try again.
- If the user wants a new code, call
sendVerificationagain for the sameTo(it resends within the same verification). - To stop a flow,
updateVerificationwithStatus=canceled.getVerificationshows the current status.
Confirm before writing: each sendVerification sends a real message or call and is billed. Confirm the destination with the user before sending, and do not resend more than needed. Never reveal or guess codes; only pass on the code the user typed.
Good to know
- Codes expire after 10 minutes; a verification is gone (404) once approved, canceled or expired.
- Max 5 send attempts and 5 check attempts per verification within 10 minutes (error 60202/60203); wait before retrying.
getVerifyServiceshowscode_lengthand enabled channels.- Phone numbers must be E.164 (
+country code, no spaces). - Requests are form-encoded.
How to use this spec
- Create a free VX Agents account (sandbox tools included).
- Open the marketplace and connect “Twilio Verify (OTP)” to an agent.
- Expose it as an MCP server for Claude/ChatGPT, or chat with it directly.