Twilio · Arazzo Workflow

Twilio Validate a Number then Send a Message

Version 1.0.0

Look up a phone number for validity and line type, then send an SMS only when the number is valid.

1 workflow 2 source APIs 1 provider
View Spec View on GitHub AuthenticationCommunicationsContact CenterEmailIoTMessagingPhoneSMST1VerificationVideoVoiceArazzoWorkflows

Provider

twilio

Workflows

lookup-then-send-message
Validate a number with Lookup, then conditionally send a message.
Fetches phone number intelligence and branches on the valid flag: sends an SMS when the number is valid and ends without sending when it is not.
2 steps inputs: accountSid, body, from, phoneNumber outputs: messageSid, valid
1
lookupNumber
Query the Lookup API for validation and line type intelligence on the supplied phone number.
2
sendMessage
Send the SMS to the validated phone number from the supplied Twilio sender.

Source API Descriptions

Arazzo Workflow Specification

Raw ↑
arazzo: 1.0.1
info:
  title: Twilio Validate a Number then Send a Message
  summary: Look up a phone number for validity and line type, then send an SMS only when the number is valid.
  description: >-
    A defensive messaging pattern that avoids wasting sends on bad numbers. The
    workflow first runs a Lookup against the supplied phone number, requesting
    the validation and line type intelligence data packages. When the number is
    reported valid it proceeds to send the SMS; when it is invalid the workflow
    ends without sending. Every step spells out its request inline so the flow
    can be read and executed without opening the underlying OpenAPI description.
  version: 1.0.0
sourceDescriptions:
- name: messagesApi
  url: ../openapi/twilio-messages-api-openapi.yml
  type: openapi
- name: phoneNumbersApi
  url: ../openapi/twilio-phone-numbers-api-openapi.yml
  type: openapi
workflows:
- workflowId: lookup-then-send-message
  summary: Validate a number with Lookup, then conditionally send a message.
  description: >-
    Fetches phone number intelligence and branches on the valid flag: sends an
    SMS when the number is valid and ends without sending when it is not.
  inputs:
    type: object
    required:
    - accountSid
    - phoneNumber
    - from
    - body
    properties:
      accountSid:
        type: string
        description: The Twilio account SID (starts with AC) used to send the message.
      phoneNumber:
        type: string
        description: The phone number to validate and message, in E.164 format.
      from:
        type: string
        description: Twilio phone number or sender ID to send the message from.
      body:
        type: string
        description: The text content of the message.
  steps:
  - stepId: lookupNumber
    description: >-
      Query the Lookup API for validation and line type intelligence on the
      supplied phone number.
    operationId: fetchPhoneNumber
    parameters:
    - name: PhoneNumber
      in: path
      value: $inputs.phoneNumber
    - name: Fields
      in: query
      value: validation,line_type_intelligence
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      valid: $response.body#/valid
      nationalFormat: $response.body#/national_format
    onSuccess:
    - name: numberValid
      type: goto
      stepId: sendMessage
      criteria:
      - context: $response.body
        condition: $.valid == true
        type: jsonpath
    - name: numberInvalid
      type: end
      criteria:
      - context: $response.body
        condition: $.valid == false
        type: jsonpath
  - stepId: sendMessage
    description: >-
      Send the SMS to the validated phone number from the supplied Twilio
      sender.
    operationId: createMessage
    parameters:
    - name: AccountSid
      in: path
      value: $inputs.accountSid
    requestBody:
      contentType: application/x-www-form-urlencoded
      payload:
        To: $inputs.phoneNumber
        From: $inputs.from
        Body: $inputs.body
    successCriteria:
    - condition: $statusCode == 201
    outputs:
      messageSid: $response.body#/sid
      status: $response.body#/status
  outputs:
    valid: $steps.lookupNumber.outputs.valid
    messageSid: $steps.sendMessage.outputs.messageSid

Work with this as data

Every workflow here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for arazzo workflows

4 MCP tools reach this
  • find_arazzoBrowse and filter every workflow in the catalog.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This workflow
curl "https://apis.io/api/v1/arazzo/twilio-lookup-then-send-message-workflow"
All arazzo workflows
curl "https://apis.io/api/v1/arazzo?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.