> For clean Markdown of any page, append .md to the page URL. > For a complete documentation index, see https://docs.jambonz.org/reference/rest-call-control/calls/create-call/llms.txt. > For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.jambonz.org/_mcp/server. # create a call POST https://api.jambonz.cloud/v1/Accounts/{AccountSid}/Calls Content-Type: application/json Reference: https://docs.jambonz.org/reference/rest-call-control/calls/create-call ## Authentication - `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer `, where token is your auth token. ## Request ### Path parameters - `AccountSid` (string, required) ### Body (application/json) This endpoint expects an object. - `from` (string, required) — The calling party number - `to` (Target, required) — Destination for call - `application_sid` (string, optional) — The application to use to control this call. Either application_sid or call_hook is required. - `answerOnBridge` (boolean, optional) — If set to true, the inbound call will ring until the number that was dialed answers the call, and at that point a 200 OK will be sent on the inbound leg. If false, the inbound call will be answered immediately as the outbound call is placed. - `call_hook` (Webhook, optional) - `call_status_hook` (Webhook, optional) - `fromHost` (string, optional) — The hostname to put in the SIP From header of the INVITE - `timeout` (integer, optional) — The number of seconds to wait for call to be answered. Defaults to 60. - `timeLimit` (integer, optional) — The max length of call in seconds - `codecs` (list of string, optional) — Codec names, in preference order, to offer on the outbound INVITE. Names are case-insensitive. When omitted the media server offers its default codecs. If any name is not supported the whole list is ignored, an error is logged and an alert is written, and default negotiation is used. - `tag` (AccountsAccountSidCallsPostRequestBodyContentApplicationJsonSchemaTag, optional) — Initial set of customer-supplied metadata to associate with the call (see jambonz 'tag' verb) - `headers` (AccountsAccountSidCallsPostRequestBodyContentApplicationJsonSchemaHeaders, optional) — The customer SIP headers to associate with the call - `sipRequestWithinDialogHook` (string, optional) — The sip indialog hook to receive session messages - `speech_synthesis_vendor` (string, optional) — The vendor for Text to Speech (required if application_sid is not used) - `speech_synthesis_language` (string, optional) — The language for Text to Speech (required if application_sid is not used) - `speech_synthesis_voice` (string, optional) — The voice for Text to Speech (required if application_sid is not used) - `speech_recognizer_vendor` (string, optional) — The vendor for Speech to Text (required if application_sid is not used) - `speech_recognizer_language` (string, optional) — The language for Speech to Text (required if application_sid is not used) - `amd` (amd, optional) - `dual_streams` (boolean, optional) — If set to true, jambonz generates an outbound INVITE whose SDP offer contains two audio media streams (two `m=audio` lines) instead of one. This is useful when the far end (for example a carrier or recording system) requires the inbound and outbound audio to be delivered on separate RTP streams. Defaults to false. Supported only when creating a call via the REST API (i.e. not available from the `dial` verb). ## Response ### 201 call successfully created - `sid` (string, required) ## Errors ### 400 Bad Request Error bad request - `any` ## Types ### Target - `type` (enum, required) - Allowed values: `phone`, `sip`, `user`, `teams` - `number` (string, optional) — A phone number to call (when type is phone) - `sipUri` (string, optional) — A SIP URI to call (when type is sip) - `tenant` (string, optional) — Microsoft Teams customer tenant domain name (when type is teams) - `trunk` (string, optional) — The name of the Carrier that should be used to deliver this call (when type is phone) - `vmail` (boolean, optional) — Dial directly into user's voicemail to leave a message (MS Teams only) - `overrideTo` (string, optional) — A SIP URI that, if provided, will be used as the To header in the outbound INVITE (not needed in most cases) - `name` (string, optional) — The name of a registered jambonz user to call (when type is user) - `auth` (TargetAuth, optional) - `proxy` (string, optional) — SIP Proxy to use for the outgoing INVITE ### Webhook - `url` (string, required) - `webhook_sid` (string, optional) - `method` (enum, optional) - Allowed values: `get`, `post` - `username` (string, optional) - `password` (string, optional) ### AccountsAccountSidCallsPostRequestBodyContentApplicationJsonSchemaTag Initial set of customer-supplied metadata to associate with the call (see jambonz 'tag' verb) ### AccountsAccountSidCallsPostRequestBodyContentApplicationJsonSchemaHeaders The customer SIP headers to associate with the call ### amd - `actionHook` (string, optional) — Webhook to send AMD events. - `thresholdWordCount` (double, optional) — Number of spoken words in a greeting that result in an amd_machine_detected result. - `digitCount` (double, optional) — Number of digits in a greeting to trigger a amd_machine_detected result. 0 is off - `timers` (AmdTimers, optional) ### TargetAuth - `username` (string, optional) — The username to use for SIP authentication, if challenged - `password` (string, optional) — The password to use for SIP authentication, if challenged ### AmdTimers - `decisionTimeoutMs` (double, optional, default: 15000) — Time in milliseconds to wait before returning amd_decision_timeout. - `greetingCompletionTimeoutMs` (double, optional, default: 2000) — Silence in milliseconds to wait for during greeting before returning amd_machine_stopped_speaking. - `noSpeechTimeoutMs` (double, optional, default: 5000) — Time in milliseconds to wait for speech before returning amd_no_speech_detected. - `toneTimeoutMs` (double, optional, default: 20000) — Time in milliseconds to wait to hear a tone. ## Examples **Request** ```json { "from": "16175551212", "to": { "type": "phone", "number": "+16172375080" } } ``` **Response** ```json { "sid": "2531329f-fb09-4ef7-887e-84e648214436" } ``` **SDK Code** ```python import requests url = "https://api.jambonz.cloud/v1/Accounts/AccountSid/Calls" payload = { "from": "16175551212", "to": { "type": "phone", "number": "+16172375080" } } headers = { "Authorization": "Bearer ", "Content-Type": "application/json" } response = requests.post(url, json=payload, headers=headers) print(response.json()) ``` ```javascript const url = 'https://api.jambonz.cloud/v1/Accounts/AccountSid/Calls'; const options = { method: 'POST', headers: {Authorization: 'Bearer ', 'Content-Type': 'application/json'}, body: '{"from":"16175551212","to":{"type":"phone","number":"+16172375080"}}' }; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` ```go package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://api.jambonz.cloud/v1/Accounts/AccountSid/Calls" payload := strings.NewReader("{\n \"from\": \"16175551212\",\n \"to\": {\n \"type\": \"phone\",\n \"number\": \"+16172375080\"\n }\n}") req, _ := http.NewRequest("POST", url, payload) req.Header.Add("Authorization", "Bearer ") req.Header.Add("Content-Type", "application/json") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```ruby require 'uri' require 'net/http' url = URI("https://api.jambonz.cloud/v1/Accounts/AccountSid/Calls") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Post.new(url) request["Authorization"] = 'Bearer ' request["Content-Type"] = 'application/json' request.body = "{\n \"from\": \"16175551212\",\n \"to\": {\n \"type\": \"phone\",\n \"number\": \"+16172375080\"\n }\n}" response = http.request(request) puts response.read_body ``` ```java import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.post("https://api.jambonz.cloud/v1/Accounts/AccountSid/Calls") .header("Authorization", "Bearer ") .header("Content-Type", "application/json") .body("{\n \"from\": \"16175551212\",\n \"to\": {\n \"type\": \"phone\",\n \"number\": \"+16172375080\"\n }\n}") .asString(); ``` ```php request('POST', 'https://api.jambonz.cloud/v1/Accounts/AccountSid/Calls', [ 'body' => '{ "from": "16175551212", "to": { "type": "phone", "number": "+16172375080" } }', 'headers' => [ 'Authorization' => 'Bearer ', 'Content-Type' => 'application/json', ], ]); echo $response->getBody(); ``` ```csharp using RestSharp; var client = new RestClient("https://api.jambonz.cloud/v1/Accounts/AccountSid/Calls"); var request = new RestRequest(Method.POST); request.AddHeader("Authorization", "Bearer "); request.AddHeader("Content-Type", "application/json"); request.AddParameter("application/json", "{\n \"from\": \"16175551212\",\n \"to\": {\n \"type\": \"phone\",\n \"number\": \"+16172375080\"\n }\n}", ParameterType.RequestBody); IRestResponse response = client.Execute(request); ``` ```swift import Foundation let headers = [ "Authorization": "Bearer ", "Content-Type": "application/json" ] let parameters = [ "from": "16175551212", "to": [ "type": "phone", "number": "+16172375080" ] ] as [String : Any] let postData = JSONSerialization.data(withJSONObject: parameters, options: []) let request = NSMutableURLRequest(url: NSURL(string: "https://api.jambonz.cloud/v1/Accounts/AccountSid/Calls")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "POST" request.allHTTPHeaderFields = headers request.httpBody = postData as Data let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error as Any) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume() ```