REST ClientCalling

dial

View as MarkdownOpen in Claude

Initiate a new outbound call. Provide either a url pointing to a SWML document or an inline swml object to control the call flow.

Since from is a Python reserved keyword, pass it as from_= or use dict unpacking: **{"from": "+15551234567"}.

Request

paramsobjectRequired
An object of parameters that will be utilized by the active command.

Response

Call LegobjectRequired
Returned when the call is a standard PSTN, SIP, or WebRTC call.
OR
Fabric Subscriber Device LegobjectRequired

Returned when the call is a Fabric subscriber device leg. The status field is always null for this type.

Example

from signalwire.rest import RestClient
client = RestClient(
project="your-project-id",
token="your-api-token",
host="your-space.signalwire.com",
)
result = client.calling.dial(
from_="+15551234567",
to="+15559876543",
url="https://example.com/call-handler",
)
print(result) # {"id": "call-id-xxx", ...}