StatusCallback URL whenever a call's state changes, so you can track calls in real time and drive your application's UI or analytics.StatusCallback (and optional StatusCallbackMethod) when creating a call, or configure the callback on an incoming phone number so all inbound calls report status.1234567const call = await client.calls.create({ to: "+2348000000001", from: "+2348000000002", twiml: "<Response><Say>Hello</Say></Response>", statusCallback: "https://app.example.com/calls/status", statusCallbackMethod: "POST", });
| Parameter | Type | Description |
CallSid optional | string | Unique identifier for the call. |
AccountSid optional | string | Your account SID. |
CallStatus optional | string | New status: queued, ringing, in-progress, completed, busy, no-answer, failed, canceled. |
From optional | string | Caller ID of the initiating party. |
To optional | string | Destination of the call. |
Direction optional | string | inbound, outbound-api, or outbound-dial. |
ApiVersion optional | string | API version (2010-04-01). |
CallDuration optional | string | Call duration in seconds (on terminal events). |
123456POST /calls/status HTTP/1.1 Host: app.example.com CallSid=CA2e9f6b3c&CallStatus=completed&From=%2B2348000000002 &To=%2B2348000000001&Direction=outbound-api&ApiVersion=2010-04-01 &CallDuration=42
X-Twilio-Signature header. Do not use this callback alone as proof that a call changed state. Restrict access to the endpoint and verify important state against the authenticated Calls API.123456import { parseWebhook, isTerminalWebhook } from "@ruut/voice-sdk"; const payload = parseWebhook(req.body); if (isTerminalWebhook(payload)) { // Confirm the state through the authenticated API before taking action. }