Get started →
API reference

Calls API

Create, list, fetch, and update calls. Outbound calls accept inline TwiML or a TwiML URL; every call reports status via webhooks.

Call resource

{
  "sid": "CA…",
  "account_sid": "AC…",
  "parent_call_sid": null,
  "phone_number_sid": "PN…",
  "to": "+2348000000001",
  "from": "+2348000000002",
  "status": "queued",
  "direction": "outbound-api",
  "duration": null,
  "start_time": null,
  "end_time": null,
  "uri": "/2010-04-01/Accounts/AC…/Calls/CA…"
}

Status values

StatusDescription
queuedReady and waiting (rate-limited).
ringingRinging the destination.
in-progressAnswered and in progress.
completedAnswered and ended normally.
busyDestination busy.
no-answerNo answer or rejected.
failedCould not be completed as dialed.
canceledCanceled via API while ringing.

Create a call

POST/2010-04-01/Accounts/{AccountSid}/Calls

Create an outbound call. Provide either Twiml (inline) or Url (fetched at answer time).

ParameterTypeDescription
To requiredstringThe number to call in E.164 (e.g. +234…), or a SIP URI like sip:agent-1001@sip.ruut.chat.
From requiredstringYour caller ID — an E.164 number you own, or an agent extension identifier.
Twiml optionalstringInline TwiML instructions (max 4000 chars). Ignored if Url is present.
Url optionalstringAbsolute URL returning TwiML. Fetched when the call connects.
Method optionalstringHTTP method for Url: GET or POST. Default POST.
StatusCallback optionalstringURL to receive call status webhooks.
StatusCallbackMethod optionalstringHTTP method for the callback: GET or POST. Default POST.

Example

curl -X POST "https://voice.ruut.chat/2010-04-01/Accounts/$RUUT_ACCOUNT_SID/Calls" \
  -u "$RUUT_ACCOUNT_SID:$RUUT_AUTH_TOKEN" \
  --data-urlencode "To=+2348000000001" \
  --data-urlencode "From=+2348000000002" \
  --data-urlencode "Twiml=<Response><Say>Hello!</Say></Response>"

Response — 201 Created

{ "sid": "CA…", "status": "queued", "direction": "outbound-api", "to": "+2348000000001" }

List calls

GET/2010-04-01/Accounts/{AccountSid}/Calls

Return calls for the account, optionally filtered.

ParameterTypeDescription
To optionalstringFilter by destination number.
From optionalstringFilter by caller ID.
Status optionalstringFilter by call status.
Page optionalinteger0-indexed page. Default 0.
PageSize optionalintegerRecords per page (max 1000). Default 50.

Response

{
  "calls": [ { "sid": "CA…", "status": "completed", … } ],
  "page": 0, "page_size": 50,
  "next_page_uri": "/2010-04-01/Accounts/AC…/Calls?Page=1&PageSize=50"
}

Fetch a call

GET/2010-04-01/Accounts/{AccountSid}/Calls/{CallSid}

Return a single call resource.

Response — 200 OK

{ "sid": "CA…", "status": "completed", "duration": "42", … }

Update a call

POST/2010-04-01/Accounts/{AccountSid}/Calls/{CallSid}

Modify a live call — end it, cancel it, or redirect it to new TwiML.

ParameterTypeDescription
Status optionalstringSet to completed to end the call, or canceled to cancel while ringing.
Url optionalstringRedirect the call to a new TwiML URL.
Twiml optionalstringRedirect with inline TwiML.
Method optionalstringHTTP method for Url: GET or POST.