Place a call
curl --request POST \
--url https://api.vocily.com/v1/calls \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"agent_id": "9b1c3d5e-7a90-4c21-8b6d-2e4f6a8c0d11",
"to_number": "+919876543210",
"from_number": "+911171366867",
"variables": {
"customer_name": "Rahul"
},
"metadata": {
"order_id": "88431"
}
}
'import requests
url = "https://api.vocily.com/v1/calls"
payload = {
"agent_id": "9b1c3d5e-7a90-4c21-8b6d-2e4f6a8c0d11",
"to_number": "+919876543210",
"from_number": "+911171366867",
"variables": { "customer_name": "Rahul" },
"metadata": { "order_id": "88431" }
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
agent_id: '9b1c3d5e-7a90-4c21-8b6d-2e4f6a8c0d11',
to_number: '+919876543210',
from_number: '+911171366867',
variables: {customer_name: 'Rahul'},
metadata: {order_id: '88431'}
})
};
fetch('https://api.vocily.com/v1/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://api.vocily.com/v1/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' => '9b1c3d5e-7a90-4c21-8b6d-2e4f6a8c0d11',
'to_number' => '+919876543210',
'from_number' => '+911171366867',
'variables' => [
'customer_name' => 'Rahul'
],
'metadata' => [
'order_id' => '88431'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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.vocily.com/v1/calls"
payload := strings.NewReader("{\n \"agent_id\": \"9b1c3d5e-7a90-4c21-8b6d-2e4f6a8c0d11\",\n \"to_number\": \"+919876543210\",\n \"from_number\": \"+911171366867\",\n \"variables\": {\n \"customer_name\": \"Rahul\"\n },\n \"metadata\": {\n \"order_id\": \"88431\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.vocily.com/v1/calls")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"agent_id\": \"9b1c3d5e-7a90-4c21-8b6d-2e4f6a8c0d11\",\n \"to_number\": \"+919876543210\",\n \"from_number\": \"+911171366867\",\n \"variables\": {\n \"customer_name\": \"Rahul\"\n },\n \"metadata\": {\n \"order_id\": \"88431\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.vocily.com/v1/calls")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"agent_id\": \"9b1c3d5e-7a90-4c21-8b6d-2e4f6a8c0d11\",\n \"to_number\": \"+919876543210\",\n \"from_number\": \"+911171366867\",\n \"variables\": {\n \"customer_name\": \"Rahul\"\n },\n \"metadata\": {\n \"order_id\": \"88431\"\n }\n}"
response = http.request(request)
puts response.read_body{
"execution_id": "c7a1e2b3-4d5f-6789-a0b1-c2d3e4f5a6b7",
"call_sid": null,
"status": "started",
"message": "Outbound call initiated; it will begin dialing shortly",
"metadata": {
"order_id": "88431"
}
}{
"code": "idempotency_key_required",
"message": "The Idempotency-Key header is required for API-key requests."
}{
"code": "unauthorized",
"message": "Missing or invalid API key."
}{
"code": "insufficient_balance",
"message": "Wallet balance is below the reserve required for this call."
}{
"code": "agent_not_allowed",
"message": "This API key is not permitted to use that agent."
}{
"code": "agent_not_found",
"message": "Agent not found in this workspace."
}{
"code": "concurrency_exceeded",
"message": "All outbound lines are currently in use."
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}{
"code": "rate_limited",
"message": "Rate limit exceeded — honor Retry-After."
}{
"code": "provider_not_configured",
"message": "The telephony provider is not configured."
}Calls
Place a call
Start an outbound voice call with one of your agents.
Place a call
curl --request POST \
--url https://api.vocily.com/v1/calls \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"agent_id": "9b1c3d5e-7a90-4c21-8b6d-2e4f6a8c0d11",
"to_number": "+919876543210",
"from_number": "+911171366867",
"variables": {
"customer_name": "Rahul"
},
"metadata": {
"order_id": "88431"
}
}
'import requests
url = "https://api.vocily.com/v1/calls"
payload = {
"agent_id": "9b1c3d5e-7a90-4c21-8b6d-2e4f6a8c0d11",
"to_number": "+919876543210",
"from_number": "+911171366867",
"variables": { "customer_name": "Rahul" },
"metadata": { "order_id": "88431" }
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
agent_id: '9b1c3d5e-7a90-4c21-8b6d-2e4f6a8c0d11',
to_number: '+919876543210',
from_number: '+911171366867',
variables: {customer_name: 'Rahul'},
metadata: {order_id: '88431'}
})
};
fetch('https://api.vocily.com/v1/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://api.vocily.com/v1/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' => '9b1c3d5e-7a90-4c21-8b6d-2e4f6a8c0d11',
'to_number' => '+919876543210',
'from_number' => '+911171366867',
'variables' => [
'customer_name' => 'Rahul'
],
'metadata' => [
'order_id' => '88431'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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.vocily.com/v1/calls"
payload := strings.NewReader("{\n \"agent_id\": \"9b1c3d5e-7a90-4c21-8b6d-2e4f6a8c0d11\",\n \"to_number\": \"+919876543210\",\n \"from_number\": \"+911171366867\",\n \"variables\": {\n \"customer_name\": \"Rahul\"\n },\n \"metadata\": {\n \"order_id\": \"88431\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.vocily.com/v1/calls")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"agent_id\": \"9b1c3d5e-7a90-4c21-8b6d-2e4f6a8c0d11\",\n \"to_number\": \"+919876543210\",\n \"from_number\": \"+911171366867\",\n \"variables\": {\n \"customer_name\": \"Rahul\"\n },\n \"metadata\": {\n \"order_id\": \"88431\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.vocily.com/v1/calls")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"agent_id\": \"9b1c3d5e-7a90-4c21-8b6d-2e4f6a8c0d11\",\n \"to_number\": \"+919876543210\",\n \"from_number\": \"+911171366867\",\n \"variables\": {\n \"customer_name\": \"Rahul\"\n },\n \"metadata\": {\n \"order_id\": \"88431\"\n }\n}"
response = http.request(request)
puts response.read_body{
"execution_id": "c7a1e2b3-4d5f-6789-a0b1-c2d3e4f5a6b7",
"call_sid": null,
"status": "started",
"message": "Outbound call initiated; it will begin dialing shortly",
"metadata": {
"order_id": "88431"
}
}{
"code": "idempotency_key_required",
"message": "The Idempotency-Key header is required for API-key requests."
}{
"code": "unauthorized",
"message": "Missing or invalid API key."
}{
"code": "insufficient_balance",
"message": "Wallet balance is below the reserve required for this call."
}{
"code": "agent_not_allowed",
"message": "This API key is not permitted to use that agent."
}{
"code": "agent_not_found",
"message": "Agent not found in this workspace."
}{
"code": "concurrency_exceeded",
"message": "All outbound lines are currently in use."
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}{
"code": "rate_limited",
"message": "Rate limit exceeded — honor Retry-After."
}{
"code": "provider_not_configured",
"message": "The telephony provider is not configured."
}The
202 is an acknowledgement — the call dials asynchronously. Track its outcome via
webhooks or GET /v1/calls/{id}.Authorizations
Your API key as a Bearer token, e.g. Authorization: Bearer vk_….
Headers
Body
application/json
Outbound call request.
Agent to use for the call
Destination number (E.164)
Our number (must be in workspace); optional if only one number
Prompt variables e.g. {customer_name: 'Rahul'}
Show child attributes
Show child attributes
Opaque customer JSON, stored + echoed on reads/webhooks
⌘I