curl --request POST \
--url https://api.itellico.ai/v1/accounts/{account_id}/calls \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"agent_id": "<string>",
"from_number": "<string>",
"to_number": "<string>",
"medium": "<string>",
"device_fingerprint": "<string>",
"external_id": "<string>",
"initial_text": "<string>",
"audio_input_enabled": true,
"audio_output_enabled": true,
"skip_greeting_on_initial_text": true,
"test_variables": {},
"overrides": {}
}
'import requests
url = "https://api.itellico.ai/v1/accounts/{account_id}/calls"
payload = {
"agent_id": "<string>",
"from_number": "<string>",
"to_number": "<string>",
"medium": "<string>",
"device_fingerprint": "<string>",
"external_id": "<string>",
"initial_text": "<string>",
"audio_input_enabled": True,
"audio_output_enabled": True,
"skip_greeting_on_initial_text": True,
"test_variables": {},
"overrides": {}
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
agent_id: '<string>',
from_number: '<string>',
to_number: '<string>',
medium: '<string>',
device_fingerprint: '<string>',
external_id: '<string>',
initial_text: '<string>',
audio_input_enabled: true,
audio_output_enabled: true,
skip_greeting_on_initial_text: true,
test_variables: {},
overrides: {}
})
};
fetch('https://api.itellico.ai/v1/accounts/{account_id}/calls', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.itellico.ai/v1/accounts/{account_id}/calls"
payload := strings.NewReader("{\n \"agent_id\": \"<string>\",\n \"from_number\": \"<string>\",\n \"to_number\": \"<string>\",\n \"medium\": \"<string>\",\n \"device_fingerprint\": \"<string>\",\n \"external_id\": \"<string>\",\n \"initial_text\": \"<string>\",\n \"audio_input_enabled\": true,\n \"audio_output_enabled\": true,\n \"skip_greeting_on_initial_text\": true,\n \"test_variables\": {},\n \"overrides\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.itellico.ai/v1/accounts/{account_id}/calls")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"agent_id\": \"<string>\",\n \"from_number\": \"<string>\",\n \"to_number\": \"<string>\",\n \"medium\": \"<string>\",\n \"device_fingerprint\": \"<string>\",\n \"external_id\": \"<string>\",\n \"initial_text\": \"<string>\",\n \"audio_input_enabled\": true,\n \"audio_output_enabled\": true,\n \"skip_greeting_on_initial_text\": true,\n \"test_variables\": {},\n \"overrides\": {}\n}")
.asString();<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.itellico.ai/v1/accounts/{account_id}/calls",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'agent_id' => '<string>',
'from_number' => '<string>',
'to_number' => '<string>',
'medium' => '<string>',
'device_fingerprint' => '<string>',
'external_id' => '<string>',
'initial_text' => '<string>',
'audio_input_enabled' => true,
'audio_output_enabled' => true,
'skip_greeting_on_initial_text' => true,
'test_variables' => [
],
'overrides' => [
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"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;
}require 'uri'
require 'net/http'
url = URI("https://api.itellico.ai/v1/accounts/{account_id}/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>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"agent_id\": \"<string>\",\n \"from_number\": \"<string>\",\n \"to_number\": \"<string>\",\n \"medium\": \"<string>\",\n \"device_fingerprint\": \"<string>\",\n \"external_id\": \"<string>\",\n \"initial_text\": \"<string>\",\n \"audio_input_enabled\": true,\n \"audio_output_enabled\": true,\n \"skip_greeting_on_initial_text\": true,\n \"test_variables\": {},\n \"overrides\": {}\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"type": "<string>",
"status": "<string>",
"created": "2023-11-07T05:31:56Z",
"modified": "2023-11-07T05:31:56Z",
"direction": "<string>",
"answer_status": "waiting",
"agent_id": "<string>",
"agent_name": "<string>",
"from_number": "<string>",
"to_number": "<string>",
"external_id": "<string>",
"started_at": "2023-11-07T05:31:56Z",
"ended_at": "2023-11-07T05:31:56Z",
"duration_seconds": 123,
"success": true,
"join": {
"token": "<string>",
"livekit_url": "<string>",
"room_sid": "<string>"
}
}{
"code": "not_found",
"detail": "Agent with UUID 123e4567-e89b-12d3-a456-426614174000 does not exist",
"message": "Resource not found"
}{
"code": "not_found",
"detail": "Agent with UUID 123e4567-e89b-12d3-a456-426614174000 does not exist",
"message": "Resource not found"
}{
"code": "not_found",
"detail": "Agent with UUID 123e4567-e89b-12d3-a456-426614174000 does not exist",
"message": "Resource not found"
}Create call
Create a public call resource for either an outbound SIP phone call or a web call. Web calls also return a short-lived LiveKit join token.
curl --request POST \
--url https://api.itellico.ai/v1/accounts/{account_id}/calls \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"agent_id": "<string>",
"from_number": "<string>",
"to_number": "<string>",
"medium": "<string>",
"device_fingerprint": "<string>",
"external_id": "<string>",
"initial_text": "<string>",
"audio_input_enabled": true,
"audio_output_enabled": true,
"skip_greeting_on_initial_text": true,
"test_variables": {},
"overrides": {}
}
'import requests
url = "https://api.itellico.ai/v1/accounts/{account_id}/calls"
payload = {
"agent_id": "<string>",
"from_number": "<string>",
"to_number": "<string>",
"medium": "<string>",
"device_fingerprint": "<string>",
"external_id": "<string>",
"initial_text": "<string>",
"audio_input_enabled": True,
"audio_output_enabled": True,
"skip_greeting_on_initial_text": True,
"test_variables": {},
"overrides": {}
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
agent_id: '<string>',
from_number: '<string>',
to_number: '<string>',
medium: '<string>',
device_fingerprint: '<string>',
external_id: '<string>',
initial_text: '<string>',
audio_input_enabled: true,
audio_output_enabled: true,
skip_greeting_on_initial_text: true,
test_variables: {},
overrides: {}
})
};
fetch('https://api.itellico.ai/v1/accounts/{account_id}/calls', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.itellico.ai/v1/accounts/{account_id}/calls"
payload := strings.NewReader("{\n \"agent_id\": \"<string>\",\n \"from_number\": \"<string>\",\n \"to_number\": \"<string>\",\n \"medium\": \"<string>\",\n \"device_fingerprint\": \"<string>\",\n \"external_id\": \"<string>\",\n \"initial_text\": \"<string>\",\n \"audio_input_enabled\": true,\n \"audio_output_enabled\": true,\n \"skip_greeting_on_initial_text\": true,\n \"test_variables\": {},\n \"overrides\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.itellico.ai/v1/accounts/{account_id}/calls")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"agent_id\": \"<string>\",\n \"from_number\": \"<string>\",\n \"to_number\": \"<string>\",\n \"medium\": \"<string>\",\n \"device_fingerprint\": \"<string>\",\n \"external_id\": \"<string>\",\n \"initial_text\": \"<string>\",\n \"audio_input_enabled\": true,\n \"audio_output_enabled\": true,\n \"skip_greeting_on_initial_text\": true,\n \"test_variables\": {},\n \"overrides\": {}\n}")
.asString();<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.itellico.ai/v1/accounts/{account_id}/calls",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'agent_id' => '<string>',
'from_number' => '<string>',
'to_number' => '<string>',
'medium' => '<string>',
'device_fingerprint' => '<string>',
'external_id' => '<string>',
'initial_text' => '<string>',
'audio_input_enabled' => true,
'audio_output_enabled' => true,
'skip_greeting_on_initial_text' => true,
'test_variables' => [
],
'overrides' => [
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"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;
}require 'uri'
require 'net/http'
url = URI("https://api.itellico.ai/v1/accounts/{account_id}/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>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"agent_id\": \"<string>\",\n \"from_number\": \"<string>\",\n \"to_number\": \"<string>\",\n \"medium\": \"<string>\",\n \"device_fingerprint\": \"<string>\",\n \"external_id\": \"<string>\",\n \"initial_text\": \"<string>\",\n \"audio_input_enabled\": true,\n \"audio_output_enabled\": true,\n \"skip_greeting_on_initial_text\": true,\n \"test_variables\": {},\n \"overrides\": {}\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"type": "<string>",
"status": "<string>",
"created": "2023-11-07T05:31:56Z",
"modified": "2023-11-07T05:31:56Z",
"direction": "<string>",
"answer_status": "waiting",
"agent_id": "<string>",
"agent_name": "<string>",
"from_number": "<string>",
"to_number": "<string>",
"external_id": "<string>",
"started_at": "2023-11-07T05:31:56Z",
"ended_at": "2023-11-07T05:31:56Z",
"duration_seconds": 123,
"success": true,
"join": {
"token": "<string>",
"livekit_url": "<string>",
"room_sid": "<string>"
}
}{
"code": "not_found",
"detail": "Agent with UUID 123e4567-e89b-12d3-a456-426614174000 does not exist",
"message": "Resource not found"
}{
"code": "not_found",
"detail": "Agent with UUID 123e4567-e89b-12d3-a456-426614174000 does not exist",
"message": "Resource not found"
}{
"code": "not_found",
"detail": "Agent with UUID 123e4567-e89b-12d3-a456-426614174000 does not exist",
"message": "Resource not found"
}Authorizations
Path Parameters
Body
Call type. Use phone for outbound SIP and web for browser-based calls.
phone, web Agent UUID
Source E.164 phone number for phone calls
Destination E.164 phone number for phone calls
Optional compatibility field. web calls always use WEB.
Optional client/device fingerprint for web calls
Optional idempotency/correlation key
Optional first user message injected into web call context
Answering-machine detection for phone calls: livekit, tool, aculab, or none.
livekit, tool, aculab, none Optional runtime variables exposed to the call worker
Optional runtime override object. Use overrides.agent with the same JSON shape as Agent PATCH (/v1/accounts/{account_id}/agents/{agent_id}).
Response
Created
How the call was answered when known (waiting, human, machine, user_rejected, user_unavailable, user_busy, or unknown).
waiting, human, machine, user_rejected, user_unavailable, user_busy, unknown LiveKit connection details returned for web calls.
Show child attributes
Show child attributes
Was this page helpful?