Create a Call
POST/Accounts/:AccountSid/Calls
Create a call.
Permissions
The API token must include the following scopes: Voice.
Request
Path Parameters
The Project ID that uniquely identifies the Account to retrieve.
- application/x-www-form-urlencoded
Body
required
The URL to handle the call. This parameter allows you to specify a webhook or different route in your code containing XML instructions for how to handle the call. This is required if ApplicationSid
is not used.
http://your-application.com/docs/voice.xml
The unique identifier of the application used to handle the call. Applications can be created within your portal or via the Create Application
endpoint and they contain a set of URLs rather than one URL, making it ideal if you want to use one configuration across many numbers. This is required if Url
is not used.
The address that initiated the call. Can be either a E.164 formatted number (+xxxxxxxxxxx
), or a SIP endpoint (sip:xxx@yyy.zzz
).
+13103384645
The address that received the call. Can be either a E.164 formatted number (+xxxxxxxxxxx
), or a SIP endpoint (sip:xxx@yyy.zzz
).
+13105678901
The number, in E.164 format, or identifier of the caller.
+13102259067
Whether the request to FallbackUrl
is a GET
or a POST
. Default is POST
. If ApplicationSid
is present, this parameter is ignored.
Possible values: [GET
, POST
]
GET
The URL SignalWire will request if errors occur when fetching the Url
. If ApplicationSid
is present, this parameter is ignored.
https://your-api-endpoint.com/path
Whether a human or machine picked up the call. Possible values are Enable
, DetectMessageEnd
and none
.
Possible values: [Enable
, DetectMessageEnd
, none
]
Whether or not to execute machine detection asynchronously. Possible values are true
or false
. Default is false
.
The URL to request when the machine detection is completed. This parameter is ignored if AsyncAmd
is false
.
https://your-api-endpoint.com/path
Whether the request to AsyncAmdStatusCallback
is a GET
or a POST
. Default is POST
.
Possible values: [GET
, POST
]
GET
Whether or not to report partial (interim) results to the callback url. Possible values are true
or false
. Default is false
. This parameter is ignored if AsyncAmd
is false
.
Number of milliseconds to wait for initial voice before giving up. Must be at least 2000
to a maximum of 10000
. Default is 5000
milliseconds.
How many milliseconds of voice to decide it is a machine. Must be at least 1000
to a maximum of 6000
. Default is 2400
milliseconds.
Number of milliseconds to wait for voice to finish. Must be at least 500
to a maximum of 5000
. Default is 1200
milliseconds.
The time SignalWire will wait for machine detection before timing out. Default is 30
seconds.
How many words to count to decide it is a machine. Must be at least one to a maximum of 100
. Default is 6
.
The maximum price in USD acceptable for the call to be created. If the rate for the call is greater than this value, the call will not be created. If not set, all calls will be created. Price can have a maximum of four decimal places, i.e. 0.0075.
0.0075
Whether the request to Url
is a GET
or a POST
. Default is POST
. Ignored if ApplicationSid
is present.
Possible values: [GET
, POST
]
Whether or not to record a call. Possible values are true
or false
. Default is false
.
The number of channels in the recording. Can be mono
(both legs of call recorded under one channel into one recording file) or dual
(each leg of call recorded in separate channels into one recording file).
The URL to request to when recording is available. See here for the list of parameters passed back to your endpoint.
https://your-api-endpoint.com/path
Whether the request to RecordingStatusCallback
URL is a GET
or a POST
. Default is POST
.
Possible values: [GET
, POST
]
POST
Specifies whether to record the inbound
audio to SignalWire from the called party or the outbound
audio from SignalWire to the called party or both
the inbound and outbound audio. Defaults to both
.
both
The username to authenticate the caller when making an outbound SIP call.
The password to authenticate the caller when making an outbound SIP call.
The digits to press after a call is connected. Possible values are (0-9)
, #
, *
, and w
. Each w
gives a 0.5 second pause before moving on to the next instruction.
w
The URL SignalWire will send webhooks to on every requested StatusCallbackEvent
event. See here for the list of parameters passed back to your endpoint.
https://your-api-endpoint.com/path
The status events that trigger a SignalWire webhook. Possible values are initiated
, ringing
, answered
, and completed
. To specify multiple events, repeat the parameter (name and value) as needed. Default is completed
.
Possible values: [initiated
, ringing
, answered
, completed
]
["completed"]
Whether the request to StatusCallback
URL is a GET
or a POST
. Default is POST
. Ignored if ApplicationSid
is present.
Possible values: [GET
, POST
]
GET
The time SignalWire will wait before assuming the call has no answer. Max wait time is 600 seconds
. Default is 60 seconds
.
60
Whether leading and trailing silence is trimmed from a recording. Possible values are trim-silence
and do-not-trim
. Default is trim-silence
.
Possible values: [trim-silence
, do-not-trim
]
trim-silence
Responses
- 200
- 400
OK
- application/json
- Schema
- Example (from schema)
Schema
The unique identifier for the account that created this call.
The annotation for the call.
Who/what the call was answered by. Possible values are human
or machine
.
Possible values: [human
, machine
]
machine
The version of the SignalWire API.
2010-04-01T00:00:00.000Z
The date, in RFC 2822 GMT format, this call was created.
Wed, 19 Sept 2018 20:00:00 +0000
The date, in RFC 2822 GMT format, this call was updated.
Wed, 19 Sept 2018 21:00:00 +0000
The direction of the call. Possible values are inbound
or outbound
.
Possible values: [inbound
, outbound
]
inbound
The duration, in seconds, of the call.
20
The time, in RFC 2822 GMT format, on which the call was terminated.
Fri, 21 Sept 2018 10:00:00 +0000
The number this call was forwarded from.
+13102259067
The address that initiated the call. Can be either a E.164 formatted number (+xxxxxxxxxxx
), or a SIP endpoint (sip:xxx@yyy.zzz
).
+13103384645
The formatted number that initiated the call.
+13102259067
The unique identifier for the call that created this call.
Outbound call: the unique identifier for OutgoingCallerId
. Inbound call: the unique identifier for IncomingPhoneNumber
.
The charge for the call.
0.003
The currency, in ISO 4127 format, for the price of the call.
USD
The unique identifier for the call.
The time, in RFC 2822 GMT format, on which the call began.
Wed, 19 Sept 2018 20:00:01 +0000
The status of the call.
Possible values: [queued
, ringing
, in-progress
, canceled
, completed
, busy
, failed
]
queued
subresource_uris
object
A Map of available sub-resources.
The URI for notifications
/api/laml/2010-04-01/Accounts/b3877c40-da60-4998-90ad-b792e98472af/Calls/b3877c40-da60-4998-90ad-b792e98472pa/Notifications.json
The URI for recordings
/api/laml/2010-04-01/Accounts/b3877c40-da60-4998-90ad-b792e98472af/Calls/b3877c40-da60-4998-90ad-b792e98472pa/Recordings.json
The address that received the call. Can be either a E.164 formatted number (+xxxxxxxxxxx
), or a SIP endpoint (sip:xxx@yyy.zzz
).
+13105678901
The formatted number that received the call.
(310) 567-8901
The URI for the call.
/api/laml/2010-04-01/Accounts/b3877c40-da60-4998-90ad-b792e98472af/Calls/b3877c40-da60-4998-90ad-b792e98472pa.json
{
"account_sid": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"annotation": "string",
"answered_by": "machine",
"api_version": "2010-04-01T00:00:00.000Z",
"date_created": "Wed, 19 Sept 2018 20:00:00 +0000",
"date_updated": "Wed, 19 Sept 2018 21:00:00 +0000",
"direction": "inbound",
"duration": 20,
"end_time": "Fri, 21 Sept 2018 10:00:00 +0000",
"forwarded_from": "+13102259067",
"from": "+13103384645",
"formatted_from": "+13102259067",
"parent_call_sid": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"phone_number_sid": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"price": 0.003,
"price_unit": "USD",
"sid": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"start_time": "Wed, 19 Sept 2018 20:00:01 +0000",
"status": "queued",
"subresource_uris": {
"notifications": "/api/laml/2010-04-01/Accounts/b3877c40-da60-4998-90ad-b792e98472af/Calls/b3877c40-da60-4998-90ad-b792e98472pa/Notifications.json",
"recordings": "/api/laml/2010-04-01/Accounts/b3877c40-da60-4998-90ad-b792e98472af/Calls/b3877c40-da60-4998-90ad-b792e98472pa/Recordings.json"
},
"to": "+13105678901",
"formatted_to": "(310) 567-8901",
"uri": "/api/laml/2010-04-01/Accounts/b3877c40-da60-4998-90ad-b792e98472af/Calls/b3877c40-da60-4998-90ad-b792e98472pa.json"
}
Error. Call not created.
- application/json
- Schema
- Example (from schema)
Schema
Array [
]
errors
object[]
A list of errors
The numeric string identifying the API error code
30010
Error text
Maxpriceperminute was exceeded. This call's cost is 0.008 per minute.
Url for more information on error code
https://developer.signalwire.com/rest/compatibility-api/error-codes
{
"errors": [
{
"code": "30010",
"message": "Maxpriceperminute was exceeded. This call's cost is 0.008 per minute.",
"more_info": "https://developer.signalwire.com/rest/compatibility-api/error-codes"
}
]
}