Voice Agents
List voice calls
List voice calls for this project, most recent first. Transcripts are omitted from the list; fetch a single call to get its transcript.
GET
/
v1
/
calls
List voice calls
curl --request GET \
--url https://api.zavu.dev/v1/calls \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.zavu.dev/v1/calls"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.zavu.dev/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.zavu.dev/v1/calls",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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://api.zavu.dev/v1/calls"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.zavu.dev/v1/calls")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.zavu.dev/v1/calls")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"items": [
{
"id": "call_abc123",
"direction": "inbound",
"from": "+13125551212",
"to": "+56912345678",
"status": "queued",
"createdAt": "2023-11-07T05:31:56Z",
"endReason": "<string>",
"answeredAt": "2023-11-07T05:31:56Z",
"endedAt": "2023-11-07T05:31:56Z",
"durationSeconds": 123,
"turnCount": 123,
"transcript": [
{
"seq": 123,
"role": "user",
"text": "<string>",
"startedAt": "2023-11-07T05:31:56Z",
"endedAt": "2023-11-07T05:31:56Z"
}
],
"cost": 123,
"metadata": {},
"updatedAt": "2023-11-07T05:31:56Z"
}
],
"nextCursor": "<string>"
}{
"code": "invalid_request",
"message": "Phone number is invalid",
"details": {}
}{
"code": "invalid_request",
"message": "Phone number is invalid",
"details": {}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Query Parameters
Lifecycle status of a voice call.
queued: outbound call created, not yet dialing.ringing: dialing (outbound) or received and ringing (inbound).in_progress: answered, the agent is connected.completed: ended after a conversation.failed: could not be completed.busy: the line was busy.no_answer: rang but was not answered.canceled: canceled before it was answered.
Available options:
queued, ringing, in_progress, completed, failed, busy, no_answer, canceled Whether the call was placed by Zavu (outbound) or received from a caller (inbound).
Available options:
inbound, outbound Keep only calls placed or received by this sender.
Required range:
x <= 100⌘I
List voice calls
curl --request GET \
--url https://api.zavu.dev/v1/calls \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.zavu.dev/v1/calls"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.zavu.dev/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.zavu.dev/v1/calls",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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://api.zavu.dev/v1/calls"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.zavu.dev/v1/calls")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.zavu.dev/v1/calls")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"items": [
{
"id": "call_abc123",
"direction": "inbound",
"from": "+13125551212",
"to": "+56912345678",
"status": "queued",
"createdAt": "2023-11-07T05:31:56Z",
"endReason": "<string>",
"answeredAt": "2023-11-07T05:31:56Z",
"endedAt": "2023-11-07T05:31:56Z",
"durationSeconds": 123,
"turnCount": 123,
"transcript": [
{
"seq": 123,
"role": "user",
"text": "<string>",
"startedAt": "2023-11-07T05:31:56Z",
"endedAt": "2023-11-07T05:31:56Z"
}
],
"cost": 123,
"metadata": {},
"updatedAt": "2023-11-07T05:31:56Z"
}
],
"nextCursor": "<string>"
}{
"code": "invalid_request",
"message": "Phone number is invalid",
"details": {}
}{
"code": "invalid_request",
"message": "Phone number is invalid",
"details": {}
}