Skip to content

Update a call

POST
/v1/Accounts/{auth_id}/Calls/{call_sid}
curl --request POST \
--url https://api.siprtc.io/v1/Accounts/AC000000000000000000/Calls/0c9b8a7d-6e5f-4a3b-9c1d-2e3f4a5b6c7d \
--header 'Authorization: Basic <credentials>' \
--header 'Content-Type: application/json' \
--data '{ "FallbackMethod": "GET", "FallbackUrl": "https://example.com/voice/fallback.xml", "Method": "GET", "Status": "completed", "StatusCallback": "https://example.com/voice/status", "StatusCallbackMethod": "GET", "TinyML": "<Response><Say>Please hold</Say><Play>https://example.com/audio/hold.mp3</Play></Response>", "Url": "https://example.com/voice/transfer.xml" }'

Changes a live call: send a new Url or TinyML to redirect it (the call leaves what it is doing and runs the new document; a Url equal to the one it is running is ignored), Status=completed to hang it up, or Status=canceled to hang it up only if it has not been answered yet; FallbackUrl, FallbackMethod and StatusCallback replace the call’s current values. The body must be JSON. An empty JSON object changes nothing and returns the call’s current details. A form post or an empty body answers 400, with the call’s current details (or an empty string) as the body. A call that is not live but has a call record waits about 5 seconds for a route, then answers 409; an unknown SID answers 404 with an empty JSON string. On success the answer is the call’s record from the call records service. A suffix after a dot in the SID (e.g. .json) is ignored.

auth_id
required
string

Your account Auth ID, or the Auth ID of a sub-account you own

Example

AC000000000000000000
call_sid
required
string

Call SID (a UUID)

Example

0c9b8a7d-6e5f-4a3b-9c1d-2e3f4a5b6c7d

What to change

Media type application/json
object
FallbackMethod

HTTP method for FallbackUrl: GET or POST.

string
Allowed values: GET POST

Example

POST
FallbackUrl

New fallback URL for the call’s TinyML requests.

string

Example

https://example.com/voice/fallback.xml
Method

HTTP method used to request Url and FallbackUrl: GET or POST.

string
Allowed values: GET POST

Example

POST
Status

completed hangs the call up. canceled hangs it up only if it has not been answered yet.

string
Allowed values: completed canceled

Example

completed
StatusCallback

New URL for the call’s status callbacks.

string

Example

https://example.com/voice/status
StatusCallbackMethod

Do not send: because of a known issue the value replaces the stored StatusCallback URL instead of its method.

string
Allowed values: GET POST

Example

TinyML

A new TinyML document for the call to run now.

string

Example

<Response><Say>Please hold</Say><Play>https://example.com/audio/hold.mp3</Play></Response>
Url

Absolute URL of a new TinyML document: the call leaves what it is doing and runs it. Ignored when it is the URL the call is already running.

string

Example

https://example.com/voice/transfer.xml

OK

Media type application/json
object
account_sid

Auth ID of the account the call belongs to.

string
annotation

Not currently populated.

string
answered_by

Not currently populated.

string
api_version

API version, v1.

string
caller_name

Caller name, when known.

string
date_created

When the call record was created.

string
date_updated

When the call record was last updated.

string
direction

outbound-api for calls created with this API.

string
duration

Billed duration in seconds, once the call has ended.

string
end_time

When the call ended.

string
forwarded_from

Not currently populated.

string
from

The caller, as given in the request.

string
from_formatted

The caller in E.164 form (digits only, with +), for number destinations.

string
group_sid

Not currently populated.

string
message

Detail text, set by some failures of the legacy hold route.

string
parent_call_sid

SID of the call that created this leg, for legs dialled from another call.

string
phone_number_sid

SID of the phone number the call used, when known.

string
price

Price of the call, once rated.

string
price_unit

Currency of price, USD.

string
queue_time

When the call was queued, e.g. Thu Nov 26 09:15:02 +0000 2026. Set on create.

string
sid

Call SID (a UUID).

string
start_time

When the call started.

string
status

Call status: queued on create; afterwards ringing, in-progress, completed, busy, no-answer, failed or canceled, as the call record holds it. The legacy hold route sets success.

string
subresource_uris

Related resources.

object
notifications

Not currently populated.

string
recordings

URI of the call’s recordings, /v1/Accounts/{auth_id}/Calls/{sid}/Recordings.

string
to

The destination, as given in the request (a configured prefix may have been removed).

string
to_formatted

The destination in E.164 form (digits only, with +), for number destinations.

string
trunk_sid

Not currently populated.

string
type

Call type from the call record, e.g. Number or Sip.

string
uri

The call’s URI, /v1/Accounts/{auth_id}/Calls/{sid}.

string

Example

{
"account_sid": "AC000000000000000000",
"annotation": "",
"answered_by": "",
"api_version": "v1",
"caller_name": "",
"date_created": "",
"date_updated": "",
"direction": "outbound-api",
"duration": "42",
"end_time": "",
"forwarded_from": "",
"from": "+15550100999",
"from_formatted": "+15550100999",
"group_sid": "",
"message": "",
"parent_call_sid": "",
"phone_number_sid": "",
"price": "",
"price_unit": "USD",
"queue_time": "Thu Nov 26 09:15:02 +0000 2026",
"sid": "0c9b8a7d-6e5f-4a3b-9c1d-2e3f4a5b6c7d",
"start_time": "",
"status": "queued",
"subresource_uris": {
"recordings": "/v1/Accounts/AC000000000000000000/Calls/0c9b8a7d-6e5f-4a3b-9c1d-2e3f4a5b6c7d/Recordings"
},
"to": "+15550100123",
"to_formatted": "+15550100123",
"trunk_sid": "",
"type": "",
"uri": "/v1/Accounts/AC000000000000000000/Calls/0c9b8a7d-6e5f-4a3b-9c1d-2e3f4a5b6c7d"
}

The body is not JSON (the body then holds the call’s current details)

Media type application/json
object
account_sid

Auth ID of the account the call belongs to.

string
annotation

Not currently populated.

string
answered_by

Not currently populated.

string
api_version

API version, v1.

string
caller_name

Caller name, when known.

string
date_created

When the call record was created.

string
date_updated

When the call record was last updated.

string
direction

outbound-api for calls created with this API.

string
duration

Billed duration in seconds, once the call has ended.

string
end_time

When the call ended.

string
forwarded_from

Not currently populated.

string
from

The caller, as given in the request.

string
from_formatted

The caller in E.164 form (digits only, with +), for number destinations.

string
group_sid

Not currently populated.

string
message

Detail text, set by some failures of the legacy hold route.

string
parent_call_sid

SID of the call that created this leg, for legs dialled from another call.

string
phone_number_sid

SID of the phone number the call used, when known.

string
price

Price of the call, once rated.

string
price_unit

Currency of price, USD.

string
queue_time

When the call was queued, e.g. Thu Nov 26 09:15:02 +0000 2026. Set on create.

string
sid

Call SID (a UUID).

string
start_time

When the call started.

string
status

Call status: queued on create; afterwards ringing, in-progress, completed, busy, no-answer, failed or canceled, as the call record holds it. The legacy hold route sets success.

string
subresource_uris

Related resources.

object
notifications

Not currently populated.

string
recordings

URI of the call’s recordings, /v1/Accounts/{auth_id}/Calls/{sid}/Recordings.

string
to

The destination, as given in the request (a configured prefix may have been removed).

string
to_formatted

The destination in E.164 form (digits only, with +), for number destinations.

string
trunk_sid

Not currently populated.

string
type

Call type from the call record, e.g. Number or Sip.

string
uri

The call’s URI, /v1/Accounts/{auth_id}/Calls/{sid}.

string

Example

{
"account_sid": "AC000000000000000000",
"annotation": "",
"answered_by": "",
"api_version": "v1",
"caller_name": "",
"date_created": "",
"date_updated": "",
"direction": "outbound-api",
"duration": "42",
"end_time": "",
"forwarded_from": "",
"from": "+15550100999",
"from_formatted": "+15550100999",
"group_sid": "",
"message": "",
"parent_call_sid": "",
"phone_number_sid": "",
"price": "",
"price_unit": "USD",
"queue_time": "Thu Nov 26 09:15:02 +0000 2026",
"sid": "0c9b8a7d-6e5f-4a3b-9c1d-2e3f4a5b6c7d",
"start_time": "",
"status": "queued",
"subresource_uris": {
"recordings": "/v1/Accounts/AC000000000000000000/Calls/0c9b8a7d-6e5f-4a3b-9c1d-2e3f4a5b6c7d/Recordings"
},
"to": "+15550100123",
"to_formatted": "+15550100123",
"trunk_sid": "",
"type": "",
"uri": "/v1/Accounts/AC000000000000000000/Calls/0c9b8a7d-6e5f-4a3b-9c1d-2e3f4a5b6c7d"
}

Authentication failed: missing or invalid credentials (JSON string from the API gateway)

Media type application/json
string

Example generated

example

No live call and no call record with this SID (body is an empty JSON string)

Media type application/json
string

Example generated

example

The call has ended or the media server refused the update

Media type application/json
object
message

Always call could not be updated.

string
status

Always failed.

string

Example

{
"message": "call could not be updated",
"status": "failed"
}