VX Agents

OpenAPI Marketplace · Messaging & SMS

Twilio Verify (OTP)

v1.0.0 · 6 endpoints · 0 connections · shared by vx.ai

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.

MethodPathOperationDescription
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

  1. Sign in to the Twilio Console (https://console.twilio.com).
  2. On the dashboard under Account Info, copy the Account SID and the Auth Token.
  3. Recommended: create a Standard API key in Account > API keys & tokens and use its SID + secret instead.
  4. 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...).
  5. 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. Use listVerifyServices if 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

  1. sendVerification with To (E.164 phone like +14155550100, or an email address for Channel=email) and Channel = sms, whatsapp, call or email. Optional Locale (e.g. es) for the message language.
  2. Tell the user a code is on its way. Keep the returned sid (VE...).
  3. When the user gives you the code, call checkVerification with To (or VerificationSid) and Code.
    • status: approved (and valid: true) = verified.
    • status: pending = wrong code; the user may try again.
  4. If the user wants a new code, call sendVerification again for the same To (it resends within the same verification).
  5. To stop a flow, updateVerification with Status=canceled. getVerification shows 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.
  • getVerifyService shows code_length and enabled channels.
  • Phone numbers must be E.164 (+ country code, no spaces).
  • Requests are form-encoded.

How to use this spec

  1. Create a free VX Agents account (sandbox tools included).
  2. Open the marketplace and connect “Twilio Verify (OTP)” to an agent.
  3. Expose it as an MCP server for Claude/ChatGPT, or chat with it directly.

Related APIs