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

    commandstringrequired

    Possible values: [dial]

    params

    object

    required

    anyOf

    urlstringrequired

    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.

    Example: https://example.com/swml
    fromstringrequired

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

    Example: sip:from-sip@example-112233445566.sip.signalwire.com
    tostringrequired

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

    Example: sip:from-sip@example-112233445567.sip.signalwire.com
    caller_idstring

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

    Example: +1234567890
    fallback_urlstring

    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.

    Example: https://example.com/fallback

Responses

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

Schema

    idstringrequired

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

    Example: 3fa85f64-5717-4562-b3fc-2c963f66afa6
    fromstringrequired

    The origin number or address.

    Example: sip:from-sip@example-112233445566.sip.signalwire.com
    tostringrequired

    The destination number or address.

    Example: sip:from-sip@example-112233445567.sip.signalwire.com
    directionstringrequired

    The direction of the call.

    Possible values: [outbound-api]

    Example: outbound-api
    statusstringrequired

    The status of the call.

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

    Example: queued
    durationintegerrequired

    The duration of the call in seconds.

    Example: 60
    duration_msintegerrequired

    The duration of the call in milliseconds.

    Example: 60000
    billable_durationintegerrequired

    The billable duration of the call in seconds.

    Example: 60
    sourcestringrequired

    Source of this call.

    Possible values: [realtime_api]

    Example: realtime_api
    typestringrequired

    Type of this call.

    Possible values: [relay_pstn_call, relay_sip_call, relay_webrtc_call]

    Example: relay_sip_call

    charge

    object[]

    required

    Details on charges associated with this call.

  • Array [

  • descriptionstringrequired

    Description for this charge.

    amountintegerrequired

    Charged amount.

  • ]