Update a Call
PUT/calls
To update an existing Call, you send a PUT
request to the Call resource with a payload including an update
command and additional nested params
.
Request
- application/json
Body
required
- Update a call with a URL
- Update a call with SWML
Possible values: [update
]
params
object
required
oneOf
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.
The id of an existing call.
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.
Possible values: [canceled
, completed
]
Either canceled
(to cancel a not yet connected call) or completed
(to end a call that is in progress).
Inline SWML, passed as a string, containing SWML instructions for handling the call. Either url
or swml
must be included for a new call.
The id of an existing call.
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.
Possible values: [canceled
, completed
]
Either canceled
(to cancel a not yet connected call) or completed
(to end a call that is in progress).
Responses
- 200
- 401
- 404
- 422
The request has succeeded.
- application/json
- Schema
- Example (from schema)
Schema
Array [
]
The unique identifier of the call on SignalWire. This can be used to update the call programmatically.
The origin number or address.
The destination number or address.
Possible values: [outbound-api
]
The direction of the call.
Possible values: [answered
, queued
, initiated
, ringing
, ending
, ended
]
The status of the call.
The duration of the call in seconds.
The duration of the call in milliseconds.
The billable duration of the call in seconds.
Possible values: [realtime_api
]
Source of this call.
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.
Description for this charge.
Charged amount.
{
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"from": "sip:from-sip@example-112233445566.sip.signalwire.com",
"to": "sip:from-sip@example-112233445567.sip.signalwire.com",
"direction": "outbound-api",
"status": "queued",
"duration": 60,
"duration_ms": 60000,
"billable_duration": 60,
"source": "realtime_api",
"type": "relay_sip_call",
"charge": [
{
"description": "string",
"amount": 0
}
]
}
Access is unauthorized.
- application/json
- Schema
Schema
string
Possible values: [Unauthorized
]
The server cannot find the requested resource.
- application/json
- Schema
Schema
string
Possible values: [Not Found
]
Client error
- application/json
- Schema
- Example (from schema)
Schema
Array [
]
errors
object[]
required
Error type.
Error code.
Error details.
Request parameter associated with this error.
Link to developer resource for this error.
{
"errors": [
{
"type": "validation_error",
"code": "missing_required_parameter",
"message": "url must be a valid http or https url",
"attribute": "url",
"url": "https://developer.signalwire.com/rest/signalwire-rest/overview/error-codes#http_url_required"
}
]
}