Twilio · Arazzo Workflow

Twilio Inspect a Call and Hang It Up If Live

Version 1.0.0

Fetch a call by SID and, when it is still in progress, update it to completed to end the call.

1 workflow 1 source API 1 provider
View Spec View on GitHub AuthenticationCommunicationsContact CenterEmailIoTMessagingPhoneSMST1VerificationVideoVoiceArazzoWorkflows

Provider

twilio

Workflows

end-active-call
Hang up a call only if it is still live.
Fetches a call by SID and conditionally updates it to completed to end the call when it is in progress or ringing.
2 steps inputs: accountSid, callSid outputs: callSid, finalStatus
1
fetchCall
Fetch the call by SID to read its current status.
2
hangUp
Update the live call with a completed status to hang it up.

Source API Descriptions

Arazzo Workflow Specification

Raw ↑
arazzo: 1.0.1
info:
  title: Twilio Inspect a Call and Hang It Up If Live
  summary: Fetch a call by SID and, when it is still in progress, update it to completed to end the call.
  description: >-
    A call control pattern. The workflow fetches a call by its SID to read the
    current status and branches: when the call is still ringing or in progress it
    updates the call resource with a completed status to hang it up, and when the
    call has already ended it stops without taking action. 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: callsApi
  url: ../openapi/twilio-calls-api-openapi.yml
  type: openapi
workflows:
- workflowId: end-active-call
  summary: Hang up a call only if it is still live.
  description: >-
    Fetches a call by SID and conditionally updates it to completed to end the
    call when it is in progress or ringing.
  inputs:
    type: object
    required:
    - accountSid
    - callSid
    properties:
      accountSid:
        type: string
        description: The Twilio account SID (starts with AC).
      callSid:
        type: string
        description: The SID of the call to inspect and possibly end (starts with CA).
  steps:
  - stepId: fetchCall
    description: >-
      Fetch the call by SID to read its current status.
    operationId: fetchCall
    parameters:
    - name: AccountSid
      in: path
      value: $inputs.accountSid
    - name: CallSid
      in: path
      value: $inputs.callSid
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      status: $response.body#/status
    onSuccess:
    - name: live
      type: goto
      stepId: hangUp
      criteria:
      - context: $response.body
        condition: $.status == "in-progress" || $.status == "ringing" || $.status == "queued"
        type: jsonpath
    - name: alreadyEnded
      type: end
      criteria:
      - context: $response.body
        condition: $.status == "completed" || $.status == "canceled" || $.status == "failed"
        type: jsonpath
  - stepId: hangUp
    description: >-
      Update the live call with a completed status to hang it up.
    operationId: updateCall
    parameters:
    - name: AccountSid
      in: path
      value: $inputs.accountSid
    - name: CallSid
      in: path
      value: $inputs.callSid
    requestBody:
      contentType: application/x-www-form-urlencoded
      payload:
        Status: completed
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      finalStatus: $response.body#/status
  outputs:
    callSid: $inputs.callSid
    finalStatus: $steps.hangUp.outputs.finalStatus

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-end-active-call-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.