arazzo: 1.0.1 info: title: Twilio Verify Start and Check a Verification summary: Start a Verify verification over a channel, then check a user-supplied code against it. description: >- The core Twilio Verify two-factor flow. The workflow starts a verification on an existing Verify service, sending a one-time code to the recipient over the chosen channel (SMS, voice, email, or WhatsApp). It then submits the code the user entered to the verification check endpoint and branches on whether the check was approved or remains pending or denied. 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: verifyApi url: ../openapi/twilio-verify-openapi.yml type: openapi workflows: - workflowId: start-and-check-verification summary: Send a verification code and validate the code the user enters. description: >- Creates a verification on a Verify service and then checks a supplied code against it, branching to approved or not-approved terminal states. inputs: type: object required: - serviceSid - to - channel - code properties: serviceSid: type: string description: The Verify service SID (starts with VA). to: type: string description: Phone number (E.164) or email address to verify. channel: type: string description: Delivery channel - one of sms, call, email, whatsapp, or sna. code: type: string description: The verification code the user entered to check. steps: - stepId: startVerification description: >- Start a verification on the service, delivering a one-time code to the recipient over the chosen channel. operationId: createVerification parameters: - name: ServiceSid in: path value: $inputs.serviceSid requestBody: contentType: application/x-www-form-urlencoded payload: To: $inputs.to Channel: $inputs.channel successCriteria: - condition: $statusCode == 201 outputs: verificationSid: $response.body#/sid status: $response.body#/status - stepId: checkVerification description: >- Submit the user-entered code to the verification check endpoint and read whether it was approved. operationId: createVerificationCheck parameters: - name: ServiceSid in: path value: $inputs.serviceSid requestBody: contentType: application/x-www-form-urlencoded payload: To: $inputs.to Code: $inputs.code successCriteria: - condition: $statusCode == 200 outputs: status: $response.body#/status valid: $response.body#/valid onSuccess: - name: approved type: end criteria: - context: $response.body condition: $.status == "approved" type: jsonpath - name: notApproved type: end criteria: - context: $response.body condition: $.status != "approved" type: jsonpath outputs: verificationSid: $steps.startVerification.outputs.verificationSid checkStatus: $steps.checkVerification.outputs.status