Create a call
const url = 'https://api.siprtc.io/v1/Accounts/AC000000000000000000/Calls';const options = { method: 'POST', headers: {Authorization: 'Basic <credentials>', 'Content-Type': 'application/json'}, body: '{"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."}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.siprtc.io/v1/Accounts/AC000000000000000000/Calls \ --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." }'Places an outbound call from From to To (a phone number or a SIP URI) and returns at once with status queued: calls are queued per account and dialled at up to 5 per second, and rating and routing happen after the response, so a 201 does not guarantee that the call connects; follow it with StatusCallback. When the call is answered SIPRTC runs, in this order of precedence, the speak text, the play file, the TinyML document or the document returned by Url. Exactly the parameters of CreateCallRequest are read, from JSON or from a form (form names are case-sensitive). Before queueing, the request is checked in this order: To (21201), From (21213), one of Url/TinyML/speak/play (21205; a play URL that does not parse gives code 5), account enabled (10001), a valid To number (21211), From owned or verified (21210, for number destinations), spendable balance of at least 0.10 (402; a login under an admin account spends the admin’s balance), and on trial (developer) accounts a verified To (21219). Trial accounts’ calls are cut off after 120 seconds, value accounts’ after 3600. The same operation is served at POST /Accounts/{auth_id}/Calls.json and, deprecated, at POST /Account/{auth_id}/Call.
Authorizations
Section titled “ Authorizations ”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “ Path Parameters ”Your account Auth ID, or the Auth ID of a sub-account you own; the call is placed in and billed to that account
Example
AC000000000000000000Request Bodyrequired
Section titled “ Request Bodyrequired ”The call to place
object
Accepted but currently ignored: the call does not use an application’s URLs, so give Url or TinyML.
Example
Accepted but ignored: detection is always asynchronous.
Example
trueAbsolute http or https URL that receives the answering-machine detection result. Required with MachineDetection.
Example
https://example.com/voice/amdHTTP method for AsyncAmdStatusCallback: GET or POST (default POST).
Example
POSTAccepted but currently ignored.
Example
Accepted but currently ignored.
Example
Accepted but currently ignored.
Example
Caller name sent with the call (SIP display name). Defaults to the From number.
Example
Acme SupportHTTP method for FallbackUrl: GET or POST.
Example
POSTAbsolute URL requested (with Method) when Url cannot be fetched or returns an error. It must return TinyML.
Example
https://example.com/voice/fallback.xmlThe 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.
Example
+15550100999Accepted but currently ignored: speak and play are always repeated three times.
Example
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.
Example
EnableMilliseconds of initial silence after which detection gives up: 2000 to 10000, default 5000.
Example
5000Milliseconds of silence that end a spoken greeting: 500 to 5000, default 1200.
Example
1200Milliseconds of speech after which the answerer is taken for a machine: 1000 to 6000, default 2400.
Example
2400Seconds detection may take: 3 to 60, default 30. Values out of range use the default.
Example
30HTTP method used to request Url and FallbackUrl: GET or POST. Any other value, or none, means POST.
Example
POSTtrue 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.
Example
trueFile format of the recording: mp3 (default) or wav.
Example
mp3dual (default) records the two parties on separate stereo channels when RecordingTrack is both; mono mixes them.
Example
dualAbsolute URL SIPRTC sends recording events to.
Example
https://example.com/voice/recordingRecording events to send: any of in-progress, completed, absent, separated by spaces. Default completed.
Example
completedHTTP method for RecordingStatusCallback: GET or POST.
Example
POSTAudio recorded: inbound (what the callee says), outbound (what is played to the callee) or both (default).
Example
bothDigits 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.
Example
ww1234#Accepted but currently ignored.
Example
Accepted but currently ignored.
Example
Absolute URL SIPRTC sends call progress events to (see StatusCallbackEvent).
Example
https://example.com/voice/statusCall 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.
Example
initiated ringing answered completedHTTP method for StatusCallback: GET or POST.
Example
POSTSeconds 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.
Example
30A 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.
Example
<Response><Say>Hello from SIPRTC</Say></Response>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.
Example
+15550100123Accepted but ignored on this route (applies to recordings started with POST …/Recordings).
Example
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.
Example
https://example.com/voice/outbound.xmlAbsolute 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.
Example
https://example.com/audio/reminder.mp3Text 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.
Example
Your appointment is tomorrow at 10 am.object
Accepted but currently ignored: the call does not use an application’s URLs, so give Url or TinyML.
Example
Accepted but ignored: detection is always asynchronous.
Example
trueAbsolute http or https URL that receives the answering-machine detection result. Required with MachineDetection.
Example
https://example.com/voice/amdHTTP method for AsyncAmdStatusCallback: GET or POST (default POST).
Example
POSTAccepted but currently ignored.
Example
Accepted but currently ignored.
Example
Accepted but currently ignored.
Example
Caller name sent with the call (SIP display name). Defaults to the From number.
Example
Acme SupportHTTP method for FallbackUrl: GET or POST.
Example
POSTAbsolute URL requested (with Method) when Url cannot be fetched or returns an error. It must return TinyML.
Example
https://example.com/voice/fallback.xmlThe 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.
Example
+15550100999Accepted but currently ignored: speak and play are always repeated three times.
Example
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.
Example
EnableMilliseconds of initial silence after which detection gives up: 2000 to 10000, default 5000.
Example
5000Milliseconds of silence that end a spoken greeting: 500 to 5000, default 1200.
Example
1200Milliseconds of speech after which the answerer is taken for a machine: 1000 to 6000, default 2400.
Example
2400Seconds detection may take: 3 to 60, default 30. Values out of range use the default.
Example
30HTTP method used to request Url and FallbackUrl: GET or POST. Any other value, or none, means POST.
Example
POSTtrue 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.
Example
trueFile format of the recording: mp3 (default) or wav.
Example
mp3dual (default) records the two parties on separate stereo channels when RecordingTrack is both; mono mixes them.
Example
dualAbsolute URL SIPRTC sends recording events to.
Example
https://example.com/voice/recordingRecording events to send: any of in-progress, completed, absent, separated by spaces. Default completed.
Example
completedHTTP method for RecordingStatusCallback: GET or POST.
Example
POSTAudio recorded: inbound (what the callee says), outbound (what is played to the callee) or both (default).
Example
bothDigits 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.
Example
ww1234#Accepted but currently ignored.
Example
Accepted but currently ignored.
Example
Absolute URL SIPRTC sends call progress events to (see StatusCallbackEvent).
Example
https://example.com/voice/statusCall 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.
Example
initiated ringing answered completedHTTP method for StatusCallback: GET or POST.
Example
POSTSeconds 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.
Example
30A 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.
Example
<Response><Say>Hello from SIPRTC</Say></Response>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.
Example
+15550100123Accepted but ignored on this route (applies to recordings started with POST …/Recordings).
Example
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.
Example
https://example.com/voice/outbound.xmlAbsolute 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.
Example
https://example.com/audio/reminder.mp3Text 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.
Example
Your appointment is tomorrow at 10 am.object
Accepted but currently ignored: the call does not use an application’s URLs, so give Url or TinyML.
Example
Accepted but ignored: detection is always asynchronous.
Example
trueAbsolute http or https URL that receives the answering-machine detection result. Required with MachineDetection.
Example
https://example.com/voice/amdHTTP method for AsyncAmdStatusCallback: GET or POST (default POST).
Example
POSTAccepted but currently ignored.
Example
Accepted but currently ignored.
Example
Accepted but currently ignored.
Example
Caller name sent with the call (SIP display name). Defaults to the From number.
Example
Acme SupportHTTP method for FallbackUrl: GET or POST.
Example
POSTAbsolute URL requested (with Method) when Url cannot be fetched or returns an error. It must return TinyML.
Example
https://example.com/voice/fallback.xmlThe 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.
Example
+15550100999Accepted but currently ignored: speak and play are always repeated three times.
Example
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.
Example
EnableMilliseconds of initial silence after which detection gives up: 2000 to 10000, default 5000.
Example
5000Milliseconds of silence that end a spoken greeting: 500 to 5000, default 1200.
Example
1200Milliseconds of speech after which the answerer is taken for a machine: 1000 to 6000, default 2400.
Example
2400Seconds detection may take: 3 to 60, default 30. Values out of range use the default.
Example
30HTTP method used to request Url and FallbackUrl: GET or POST. Any other value, or none, means POST.
Example
POSTtrue 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.
Example
trueFile format of the recording: mp3 (default) or wav.
Example
mp3dual (default) records the two parties on separate stereo channels when RecordingTrack is both; mono mixes them.
Example
dualAbsolute URL SIPRTC sends recording events to.
Example
https://example.com/voice/recordingRecording events to send: any of in-progress, completed, absent, separated by spaces. Default completed.
Example
completedHTTP method for RecordingStatusCallback: GET or POST.
Example
POSTAudio recorded: inbound (what the callee says), outbound (what is played to the callee) or both (default).
Example
bothDigits 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.
Example
ww1234#Accepted but currently ignored.
Example
Accepted but currently ignored.
Example
Absolute URL SIPRTC sends call progress events to (see StatusCallbackEvent).
Example
https://example.com/voice/statusCall 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.
Example
initiated ringing answered completedHTTP method for StatusCallback: GET or POST.
Example
POSTSeconds 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.
Example
30A 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.
Example
<Response><Say>Hello from SIPRTC</Say></Response>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.
Example
+15550100123Accepted but ignored on this route (applies to recordings started with POST …/Recordings).
Example
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.
Example
https://example.com/voice/outbound.xmlAbsolute 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.
Example
https://example.com/audio/reminder.mp3Text 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.
Example
Your appointment is tomorrow at 10 am.Responses
Section titled “ Responses ”Call queued: sid, account_sid, from, to, *_formatted, direction outbound-api, status queued, queue_time, uri
object
Auth ID of the account the call belongs to.
Not currently populated.
Not currently populated.
API version, v1.
Caller name, when known.
When the call record was created.
When the call record was last updated.
outbound-api for calls created with this API.
Billed duration in seconds, once the call has ended.
When the call ended.
Not currently populated.
The caller, as given in the request.
The caller in E.164 form (digits only, with +), for number destinations.
Not currently populated.
Detail text, set by some failures of the legacy hold route.
SID of the call that created this leg, for legs dialled from another call.
SID of the phone number the call used, when known.
Price of the call, once rated.
Currency of price, USD.
When the call was queued, e.g. Thu Nov 26 09:15:02 +0000 2026. Set on create.
Call SID (a UUID).
When the call started.
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.
Related resources.
object
Not currently populated.
URI of the call’s recordings, /v1/Accounts/{auth_id}/Calls/{sid}/Recordings.
The destination, as given in the request (a configured prefix may have been removed).
The destination in E.164 form (digits only, with +), for number destinations.
Not currently populated.
Call type from the call record, e.g. Number or Sip.
The call’s URI, /v1/Accounts/{auth_id}/Calls/{sid}.
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 (codes 21201, 21213, 21205, 5, 21211), the From number is not owned or verified (21210), the To number is not verified on a trial account (21219), the account is disabled (10001), or the body could not be read or the call could not be queued (21210, "Request is not able to decode, Please check and send again")
object
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.
Human-readable explanation.
A link for more information: https:// followed by the host the request was sent to, without its api. prefix.
The HTTP status of the response.
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)
Example generated
exampleBalance below 0.10 ("You don’t have sufficient balance, please recharge")
object
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.
Human-readable explanation.
A link for more information: https:// followed by the host the request was sent to, without its api. prefix.
The HTTP status of the response.
Example
{ "code": 21201, "message": "No 'To' number is specified", "more_info": "https://siprtc.io", "status": 400}