Skip to content

Create a call (legacy path)

Deprecated
POST
/v1/Account/{auth_id}/Call
curl --request POST \
--url https://api.siprtc.io/v1/Account/AC000000000000000000/Call \
--header 'Authorization: Basic <credentials>' \
--header 'Content-Type: application/json' \
--data '{ "ApplicationSid": "", "AsyncAmd": "true", "AsyncAmdStatusCallback": "https://example.com/voice/amd", "AsyncAmdStatusCallbackMethod": "GET", "Byoc": "", "CallReason": "", "CallerId": "", "CallerName": "Acme Support", "FallbackMethod": "GET", "FallbackUrl": "https://example.com/voice/fallback.xml", "From": "+15550100999", "LoopPlay": "", "MachineDetection": "Enable", "MachineDetectionSilenceTimeout": "5000", "MachineDetectionSpeechEndThreshold": "1200", "MachineDetectionSpeechThreshold": "2400", "MachineDetectionTimeout": "30", "Method": "GET", "Record": "true", "RecordFormat": "mp3", "RecordingChannels": "mono", "RecordingStatusCallback": "https://example.com/voice/recording", "RecordingStatusCallbackEvent": "completed", "RecordingStatusCallbackMethod": "GET", "RecordingTrack": "inbound", "SendDigits": "ww1234#", "SipAuthPassword": "", "SipAuthUsername": "", "StatusCallback": "https://example.com/voice/status", "StatusCallbackEvent": "initiated ringing answered completed", "StatusCallbackMethod": "GET", "Timeout": "30", "TinyML": "<Response><Say>Hello from SIPRTC</Say></Response>", "To": "+15550100123", "Trim": "", "Url": "https://example.com/voice/outbound.xml", "play": "https://example.com/audio/reminder.mp3", "speak": "Your appointment is tomorrow at 10 am." }'

Deprecated: use POST /Accounts/{auth_id}/Calls (createCall). The same operation, with the same parameters, checks, responses and errors, served at the older /Account/{auth_id}/Call path.

auth_id
required
string

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

Example

AC000000000000000000

The call to place

object
ApplicationSid

Accepted but currently ignored: the call does not use an application’s URLs, so give Url or TinyML.

string

Example

AsyncAmd

Accepted but ignored: detection is always asynchronous.

string

Example

true
AsyncAmdStatusCallback

Absolute http or https URL that receives the answering-machine detection result. Required with MachineDetection.

string

Example

https://example.com/voice/amd
AsyncAmdStatusCallbackMethod

HTTP method for AsyncAmdStatusCallback: GET or POST (default POST).

string
Allowed values: GET POST

Example

POST
Byoc

Accepted but currently ignored.

string

Example

CallReason

Accepted but currently ignored.

string

Example

CallerId

Accepted but currently ignored.

string

Example

CallerName

Caller name sent with the call (SIP display name). Defaults to the From number.

string

Example

Acme Support
FallbackMethod

HTTP method for FallbackUrl: GET or POST.

string
Allowed values: GET POST

Example

POST
FallbackUrl

Absolute URL requested (with Method) when Url cannot be fetched or returns an error. It must return TinyML.

string

Example

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

The caller ID. For calls to phone numbers it must be a number your account owns or has verified (VerifiedPhoneNumbers), unless caller-ID checking is turned off for your account. It is not checked for calls to SIP URIs.

string

Example

+15550100999
LoopPlay

Accepted but currently ignored: speak and play are always repeated three times.

string

Example

MachineDetection

Answering-machine detection: Enable or DetectMessageEnd. Detection runs asynchronously and its result is posted to AsyncAmdStatusCallback, which is required: without a valid http or https URL there, detection is turned off.

string
Allowed values: Enable DetectMessageEnd

Example

Enable
MachineDetectionSilenceTimeout

Milliseconds of initial silence after which detection gives up: 2000 to 10000, default 5000.

string

Example

5000
MachineDetectionSpeechEndThreshold

Milliseconds of silence that end a spoken greeting: 500 to 5000, default 1200.

string

Example

1200
MachineDetectionSpeechThreshold

Milliseconds of speech after which the answerer is taken for a machine: 1000 to 6000, default 2400.

string

Example

2400
MachineDetectionTimeout

Seconds detection may take: 3 to 60, default 30. Values out of range use the default.

string

Example

30
Method

HTTP method used to request Url and FallbackUrl: GET or POST. Any other value, or none, means POST.

string
Allowed values: GET POST

Example

POST
Record

true records the call from the moment it is answered. The account’s recording policy may refuse the recording; the call is then placed without it. Other values do not record.

string
Allowed values: true false

Example

true
RecordFormat

File format of the recording: mp3 (default) or wav.

string
Allowed values: mp3 wav

Example

mp3
RecordingChannels

dual (default) records the two parties on separate stereo channels when RecordingTrack is both; mono mixes them.

string
Allowed values: mono dual

Example

dual
RecordingStatusCallback

Absolute URL SIPRTC sends recording events to.

string

Example

https://example.com/voice/recording
RecordingStatusCallbackEvent

Recording events to send: any of in-progress, completed, absent, separated by spaces. Default completed.

string

Example

completed
RecordingStatusCallbackMethod

HTTP method for RecordingStatusCallback: GET or POST.

string
Allowed values: GET POST

Example

POST
RecordingTrack

Audio recorded: inbound (what the callee says), outbound (what is played to the callee) or both (default).

string
Allowed values: inbound outbound both

Example

both
SendDigits

Digits sent as DTMF tones once the call is answered: 0-9, *, #, and w for a half-second pause. A value with any other character is dropped.

string

Example

ww1234#
SipAuthPassword

Accepted but currently ignored.

string

Example

SipAuthUsername

Accepted but currently ignored.

string

Example

StatusCallback

Absolute URL SIPRTC sends call progress events to (see StatusCallbackEvent).

string

Example

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

Call progress events to send to StatusCallback: any of initiated, ringing, answered, completed, separated by spaces. Only completed is sent when empty. Give the list in one parameter: when the form parameter is repeated only the first value is read.

string

Example

initiated ringing answered completed
StatusCallbackMethod

HTTP method for StatusCallback: GET or POST.

string
Allowed values: GET POST

Example

POST
Timeout

Seconds to let the destination ring before giving up. Default 60; values of 600 or more are ignored. About 5 seconds are added to the value.

string

Example

30
TinyML

A TinyML document to run when the call is answered, instead of fetching Url. The document is URL-decoded before use, so a literal + or % in it must be sent as %2B or %25; a URL-encoded document works as is.

string

Example

<Response><Say>Hello from SIPRTC</Say></Response>
To

The destination. A phone number in E.164 format (the + is optional; spaces, dashes and other non-digits are ignored) or a SIP URI starting with sip: or sips:. Custom SIP headers can be appended after ?, as name=value pairs joined by &, e.g. sip:alice@example.com?X-Ticket=123. Phone numbers must be valid numbers. On trial (developer) accounts only numbers you have verified or bought can be called.

string

Example

+15550100123
Trim

Accepted but ignored on this route (applies to recordings started with POST …/Recordings).

string

Example

Url

Absolute URL that returns the TinyML document to run when the call is answered. One of Url, TinyML, speak or play is required. When several are given, speak wins, then play, then TinyML, then Url.

string

Example

https://example.com/voice/outbound.xml
play

Absolute URL of an MP3 or WAV file played to the callee when the call is answered; the file is played three times and the call is then hung up. JSON also accepts Play.

string

Example

https://example.com/audio/reminder.mp3
speak

Text spoken to the callee when the call is answered; the text is spoken three times and the call is then hung up. JSON also accepts Speak.

string

Example

Your appointment is tomorrow at 10 am.

Created

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"
}

A parameter is missing or invalid, the From number is not yours, or the account is disabled

Media type application/json
object
code

Error code, e.g. 21201 (no To), 21213 (no From), 21205 (no Url), 21211 (invalid To), 21210 (From not verified, or unreadable request), 21219 (To not verified on a trial account), 10001 (account not active), 20001 (invalid parameter), 20009 (no live call to delete). The insufficient-balance error carries 258.

integer
message

Human-readable explanation.

string
more_info

A link for more information: https:// followed by the host the request was sent to, without its api. prefix.

string
status

The HTTP status of the response.

integer

Example

{
"code": 21201,
"message": "No 'To' number is specified",
"more_info": "https://siprtc.io",
"status": 400
}

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

Media type application/json
string

Example generated

example

Balance below 0.10

Media type application/json
object
code

Error code, e.g. 21201 (no To), 21213 (no From), 21205 (no Url), 21211 (invalid To), 21210 (From not verified, or unreadable request), 21219 (To not verified on a trial account), 10001 (account not active), 20001 (invalid parameter), 20009 (no live call to delete). The insufficient-balance error carries 258.

integer
message

Human-readable explanation.

string
more_info

A link for more information: https:// followed by the host the request was sent to, without its api. prefix.

string
status

The HTTP status of the response.

integer

Example

{
"code": 21201,
"message": "No 'To' number is specified",
"more_info": "https://siprtc.io",
"status": 400
}