Dial Outbound Phone Call
curl --request POST \
--url https://api.verbex.ai/v1/calls/dial-outbound-phone-call \
--header 'Content-Type: application/json' \
--data '
{
"from_number": "<string>",
"to_number": "<string>",
"direction": "outbound",
"call_id": "<string>",
"override_ai_agent_id": "<string>",
"metadata": {},
"pia_llm_dynamic_data": {}
}
'import requests
url = "https://api.verbex.ai/v1/calls/dial-outbound-phone-call"
payload = {
"from_number": "<string>",
"to_number": "<string>",
"direction": "outbound",
"call_id": "<string>",
"override_ai_agent_id": "<string>",
"metadata": {},
"pia_llm_dynamic_data": {}
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
from_number: '<string>',
to_number: '<string>',
direction: 'outbound',
call_id: '<string>',
override_ai_agent_id: '<string>',
metadata: {},
pia_llm_dynamic_data: {}
})
};
fetch('https://api.verbex.ai/v1/calls/dial-outbound-phone-call', 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://api.verbex.ai/v1/calls/dial-outbound-phone-call",
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([
'from_number' => '<string>',
'to_number' => '<string>',
'direction' => 'outbound',
'call_id' => '<string>',
'override_ai_agent_id' => '<string>',
'metadata' => [
],
'pia_llm_dynamic_data' => [
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.verbex.ai/v1/calls/dial-outbound-phone-call"
payload := strings.NewReader("{\n \"from_number\": \"<string>\",\n \"to_number\": \"<string>\",\n \"direction\": \"outbound\",\n \"call_id\": \"<string>\",\n \"override_ai_agent_id\": \"<string>\",\n \"metadata\": {},\n \"pia_llm_dynamic_data\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
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.verbex.ai/v1/calls/dial-outbound-phone-call")
.header("Content-Type", "application/json")
.body("{\n \"from_number\": \"<string>\",\n \"to_number\": \"<string>\",\n \"direction\": \"outbound\",\n \"call_id\": \"<string>\",\n \"override_ai_agent_id\": \"<string>\",\n \"metadata\": {},\n \"pia_llm_dynamic_data\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.verbex.ai/v1/calls/dial-outbound-phone-call")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"from_number\": \"<string>\",\n \"to_number\": \"<string>\",\n \"direction\": \"outbound\",\n \"call_id\": \"<string>\",\n \"override_ai_agent_id\": \"<string>\",\n \"metadata\": {},\n \"pia_llm_dynamic_data\": {}\n}"
response = http.request(request)
puts response.read_body{
"call_status": "registered",
"from_number": "<string>",
"to_number": "<string>",
"direction": "inbound",
"_id": "<string>",
"ai_agent_id": "<string>",
"ai_agent_name": "<string>",
"override_ai_agent_id": "<string>",
"metadata": {},
"pia_llm_dynamic_data": {},
"call_start_time": "2023-11-07T05:31:56Z",
"call_end_time": "2023-11-07T05:31:56Z",
"messages": [
{
"role": "agent",
"content": "<string>",
"started_at": "<string>",
"ended_at": "<string>"
}
],
"recorded_call_audio_url": "<string>",
"access_token": "<string>",
"call_duration_seconds": 123,
"call_type": "phone_call",
"call_finish_reason": "user_ended_call",
"call_id": "<string>",
"call_reference_id": "<string>",
"updated_date_time": "2023-11-07T05:31:56Z",
"batch_id": "<string>"
}Calls
Dial Outbound Phone Call
Initiate an outbound phone call from an AI agent to a specified phone number.
This endpoint triggers the AI agent to place a phone call to the provided number. Use this for scenarios where the AI needs to proactively contact users via phone.
The call is rejected with 422 when:
from_numberorto_numberis missing, ordirectionis notoutboundfrom_numberis not a registered phone number, or has no outbound concurrency configured- the agent assigned to
from_numberis not found or does not belong to your organization to_numberis on the DND (Do Not Disturb) list- the organization does not have sufficient balance
429 is returned when the concurrent call limit is reached.
POST
/
v1
/
calls
/
dial-outbound-phone-call
Dial Outbound Phone Call
curl --request POST \
--url https://api.verbex.ai/v1/calls/dial-outbound-phone-call \
--header 'Content-Type: application/json' \
--data '
{
"from_number": "<string>",
"to_number": "<string>",
"direction": "outbound",
"call_id": "<string>",
"override_ai_agent_id": "<string>",
"metadata": {},
"pia_llm_dynamic_data": {}
}
'import requests
url = "https://api.verbex.ai/v1/calls/dial-outbound-phone-call"
payload = {
"from_number": "<string>",
"to_number": "<string>",
"direction": "outbound",
"call_id": "<string>",
"override_ai_agent_id": "<string>",
"metadata": {},
"pia_llm_dynamic_data": {}
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
from_number: '<string>',
to_number: '<string>',
direction: 'outbound',
call_id: '<string>',
override_ai_agent_id: '<string>',
metadata: {},
pia_llm_dynamic_data: {}
})
};
fetch('https://api.verbex.ai/v1/calls/dial-outbound-phone-call', 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://api.verbex.ai/v1/calls/dial-outbound-phone-call",
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([
'from_number' => '<string>',
'to_number' => '<string>',
'direction' => 'outbound',
'call_id' => '<string>',
'override_ai_agent_id' => '<string>',
'metadata' => [
],
'pia_llm_dynamic_data' => [
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.verbex.ai/v1/calls/dial-outbound-phone-call"
payload := strings.NewReader("{\n \"from_number\": \"<string>\",\n \"to_number\": \"<string>\",\n \"direction\": \"outbound\",\n \"call_id\": \"<string>\",\n \"override_ai_agent_id\": \"<string>\",\n \"metadata\": {},\n \"pia_llm_dynamic_data\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
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.verbex.ai/v1/calls/dial-outbound-phone-call")
.header("Content-Type", "application/json")
.body("{\n \"from_number\": \"<string>\",\n \"to_number\": \"<string>\",\n \"direction\": \"outbound\",\n \"call_id\": \"<string>\",\n \"override_ai_agent_id\": \"<string>\",\n \"metadata\": {},\n \"pia_llm_dynamic_data\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.verbex.ai/v1/calls/dial-outbound-phone-call")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"from_number\": \"<string>\",\n \"to_number\": \"<string>\",\n \"direction\": \"outbound\",\n \"call_id\": \"<string>\",\n \"override_ai_agent_id\": \"<string>\",\n \"metadata\": {},\n \"pia_llm_dynamic_data\": {}\n}"
response = http.request(request)
puts response.read_body{
"call_status": "registered",
"from_number": "<string>",
"to_number": "<string>",
"direction": "inbound",
"_id": "<string>",
"ai_agent_id": "<string>",
"ai_agent_name": "<string>",
"override_ai_agent_id": "<string>",
"metadata": {},
"pia_llm_dynamic_data": {},
"call_start_time": "2023-11-07T05:31:56Z",
"call_end_time": "2023-11-07T05:31:56Z",
"messages": [
{
"role": "agent",
"content": "<string>",
"started_at": "<string>",
"ended_at": "<string>"
}
],
"recorded_call_audio_url": "<string>",
"access_token": "<string>",
"call_duration_seconds": 123,
"call_type": "phone_call",
"call_finish_reason": "user_ended_call",
"call_id": "<string>",
"call_reference_id": "<string>",
"updated_date_time": "2023-11-07T05:31:56Z",
"batch_id": "<string>"
}Body
application/json
Response
Successful Response
Detailed reason why the phone call ended, if applicable
Available options:
user_ended_call, agent_ended_call, call_transferred, voicemail_detected, inactivity_timeout, answering_machine_detected, maximum_duration_exceeded, concurrent_call_limit_reached, invalid_payment, potential_scam_detected, inbound_webhook_error, line_busy, call_failed, no_answer, llm_websocket_initialization_error, llm_websocket_connection_lost, llm_websocket_runtime_error, llm_websocket_payload_corruption, frontend_payload_corruption, twilio_service_error, no_audio_input, speech_recognition_error, verbex_service_error, unknown_error, user_connection_failure, registered_call_timed_out 
