Create outbound call
curl --request POST \
--url https://cloud.kolavoice.com/api/v1/outbound/calls \
--header 'x-api-key: <api-key>'import requests
url = "https://cloud.kolavoice.com/api/v1/outbound/calls"
headers = {"x-api-key": "<api-key>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {'x-api-key': '<api-key>'}};
fetch('https://cloud.kolavoice.com/api/v1/outbound/calls', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://cloud.kolavoice.com/api/v1/outbound/calls",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://cloud.kolavoice.com/api/v1/outbound/calls"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("x-api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://cloud.kolavoice.com/api/v1/outbound/calls")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://cloud.kolavoice.com/api/v1/outbound/calls")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_bodyAPI Reference
Create outbound call
Launch an outbound AI phone call.
POST
/
outbound
/
calls
Create outbound call
curl --request POST \
--url https://cloud.kolavoice.com/api/v1/outbound/calls \
--header 'x-api-key: <api-key>'import requests
url = "https://cloud.kolavoice.com/api/v1/outbound/calls"
headers = {"x-api-key": "<api-key>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {'x-api-key': '<api-key>'}};
fetch('https://cloud.kolavoice.com/api/v1/outbound/calls', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://cloud.kolavoice.com/api/v1/outbound/calls",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://cloud.kolavoice.com/api/v1/outbound/calls"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("x-api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://cloud.kolavoice.com/api/v1/outbound/calls")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://cloud.kolavoice.com/api/v1/outbound/calls")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_bodyCreate outbound call
Launches an outbound AI phone call immediately.Example request
curl -X POST "https://cloud.kolavoice.com/api/v1/outbound/calls" \
-H "X-API-Key: kva_live_xxxxxxxxxxxx_xxxxxxxxxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{
"to_number": "+256782435630",
"agent_id": "836ca07f-98ad-47ec-bfc6-afd457fa2b16",
"from_number": "+256323200643"
}'
Example response
{
"call_id": "ec40a1f1-0b15-408b-a6f4-79314c0b89f9",
"room_name": "call-836ca07f-1783580857-94e4c116",
"status": "dialing",
"to_number": "+256782435630",
"agent": "General Outbound Agent"
}
Common errors
| Status | Meaning |
|---|---|
400 | Invalid from_number, missing outbound-enabled number, or invalid request |
401 | Invalid or missing API key |
402 | Wallet balance is too low to start the call |
404 | Agent not found |
503 | Calling is under maintenance |
⌘I