Skip to main content

Create a Call

POST 

/calls

To create a new Call, you send a POST request to the Call resource with a payload including a dial command and additional nested params.

Request

Body

required

    command stringrequired

    Possible values: [dial]

    params

    object

    required

    anyOf

    url stringrequired

    The URL to handle the call. This parameter allows you to specify a webhook or different route in your code containing SWML instructions for handling the call. Either url or swml must be included for a new call.

    from stringrequired

    The address that initiated the call. Can be either a E.164 formatted number (+xxxxxxxxxxx), or a SIP endpoint (sip:xxx@yyy.zzz).

    to stringrequired

    The address that received the call. Can be either a E.164 formatted number (+xxxxxxxxxxx), or a SIP endpoint (sip:xxx@yyy.zzz).

    caller_id string

    The number, in E.164 format, or identifier of the caller.

    fallback_url string

    The Fallback URL to handle the call. This parameter allows you to specify a backup webhook or different route in your code containing SWML instructions for handling the call.

Responses

The request has succeeded and a new resource has been created as a result.

Schema

    id stringrequired

    The unique identifier of the call on SignalWire. This can be used to update the call programmatically.

    from stringrequired

    The origin number or address.

    to stringrequired

    The destination number or address.

    direction stringrequired

    Possible values: [outbound-api]

    The direction of the call.

    status stringrequired

    Possible values: [answered, queued, initiated, ringing, ending, ended]

    The status of the call.

    duration integerrequired

    The duration of the call in seconds.

    duration_ms integerrequired

    The duration of the call in milliseconds.

    billable_duration integerrequired

    The billable duration of the call in seconds.

    source stringrequired

    Possible values: [realtime_api]

    Source of this call.

    type stringrequired

    Possible values: [relay_pstn_call, relay_sip_call, relay_webrtc_call]

    Type of this call.

    charge

    object[]

    required

    Details on charges associated with this call.

  • Array [

  • description stringrequired

    Description for this charge.

    amount integerrequired

    Charged amount.

  • ]

Loading...