Get Phone Call History
curl --request GET \
--url https://api.ravan.ai/api/v1/calling/phone-history \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.ravan.ai/api/v1/calling/phone-history"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.ravan.ai/api/v1/calling/phone-history', 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.ravan.ai/api/v1/calling/phone-history",
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.ravan.ai/api/v1/calling/phone-history"
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.ravan.ai/api/v1/calling/phone-history")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ravan.ai/api/v1/calling/phone-history")
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{
"success": true,
"message": "call history retrieved successfully",
"phone": "+919876543210",
"total_count": 3,
"page": 1,
"page_size": 20,
"calls": [
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"agent_id": "8f14e45f-ceea-467f-a1d1-91ad4fb0e6c4",
"agent_name": "Support Agent",
"organization_id": "0b2c1d3e-4f56-4789-9abc-def012345678",
"caller_number": "+14155550100",
"callee_number": "+919876543210",
"caller_name": "Jane Doe",
"caller_email": "jane@example.com",
"channel": "phone",
"status": "completed",
"summary": "Customer asked about billing.",
"recording_url": "https://api.example.com/api/v1/calling/sessions/550e8400-e29b-41d4-a716-446655440000/recording",
"duration_sec": 250,
"cost_total": "12.50",
"twilio_cost": 5.1,
"model_cost": 4.2,
"credit_breakdown": {
"model_credits": 4.2,
"provider_credits": 5.1,
"telephony_base_credits": 4.0
},
"disconnect_reason": "user_hangup",
"call_latency_ms": 820,
"error_message": "",
"post_call_analysis_result": {
"sentiment": "positive"
},
"metadata": {
"source": "crm"
},
"started_at": "2026-06-11T09:30:00Z",
"ended_at": "2026-06-11T09:34:10Z",
"created_at": "2026-06-11T09:29:58Z",
"transcripts": [
{
"id": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
"call_session_id": "550e8400-e29b-41d4-a716-446655440000",
"message": {
"role": "agent",
"content": "Hello!"
},
"timestamp_ms": 1765437000123,
"created_at": "2026-06-11T09:30:01Z"
}
]
}
]
}
Calling API
Phone Call History
Returns all calls where a phone number appears as caller or callee, with cost and credit details and optional transcripts.
GET
/
api
/
v1
/
calling
/
phone-history
Get Phone Call History
curl --request GET \
--url https://api.ravan.ai/api/v1/calling/phone-history \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.ravan.ai/api/v1/calling/phone-history"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.ravan.ai/api/v1/calling/phone-history', 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.ravan.ai/api/v1/calling/phone-history",
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.ravan.ai/api/v1/calling/phone-history"
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.ravan.ai/api/v1/calling/phone-history")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ravan.ai/api/v1/calling/phone-history")
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{
"success": true,
"message": "call history retrieved successfully",
"phone": "+919876543210",
"total_count": 3,
"page": 1,
"page_size": 20,
"calls": [
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"agent_id": "8f14e45f-ceea-467f-a1d1-91ad4fb0e6c4",
"agent_name": "Support Agent",
"organization_id": "0b2c1d3e-4f56-4789-9abc-def012345678",
"caller_number": "+14155550100",
"callee_number": "+919876543210",
"caller_name": "Jane Doe",
"caller_email": "jane@example.com",
"channel": "phone",
"status": "completed",
"summary": "Customer asked about billing.",
"recording_url": "https://api.example.com/api/v1/calling/sessions/550e8400-e29b-41d4-a716-446655440000/recording",
"duration_sec": 250,
"cost_total": "12.50",
"twilio_cost": 5.1,
"model_cost": 4.2,
"credit_breakdown": {
"model_credits": 4.2,
"provider_credits": 5.1,
"telephony_base_credits": 4.0
},
"disconnect_reason": "user_hangup",
"call_latency_ms": 820,
"error_message": "",
"post_call_analysis_result": {
"sentiment": "positive"
},
"metadata": {
"source": "crm"
},
"started_at": "2026-06-11T09:30:00Z",
"ended_at": "2026-06-11T09:34:10Z",
"created_at": "2026-06-11T09:29:58Z",
"transcripts": [
{
"id": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
"call_session_id": "550e8400-e29b-41d4-a716-446655440000",
"message": {
"role": "agent",
"content": "Hello!"
},
"timestamp_ms": 1765437000123,
"created_at": "2026-06-11T09:30:01Z"
}
]
}
]
}
Authorizations
string
Bearer JWT used to authenticate the request.
string
Org API key. You can use this instead of JWT.
Query Parameters
string
required
Phone number in E.164 format. Example:
+1234567890.integer
Page number to return. Defaults to
1.integer
Results per page. Defaults to
20 and maximum is 100.boolean
Set to
true to include transcripts in each call result.Response
boolean
Whether the request succeeded.
string
Human-readable status message.
string
The phone number used for the lookup.
integer
Total number of matching calls.
integer
Current page number.
integer
Number of results returned per page.
array
Matching calls.
Show calls[]
Show calls[]
string
Call session UUID.
string
Agent UUID.
string
Agent name.
string
Organization UUID.
string
Caller phone number.
string
Callee phone number.
string
Caller name.
string
Caller email.
string
Call channel.
string
Call status.
string
Call summary.
string
Recording URL.
integer
Call duration in seconds.
string
Total call cost.
number
Telephony provider cost.
number
Model cost.
object
Credit usage breakdown.
string
Disconnect reason.
integer
Call latency in milliseconds.
string
Error message, if any.
object
Post-call analysis result.
object
Custom metadata.
string
Start timestamp.
string
End timestamp.
string
Creation timestamp.
array
Transcript entries when requested.
{
"success": true,
"message": "call history retrieved successfully",
"phone": "+919876543210",
"total_count": 3,
"page": 1,
"page_size": 20,
"calls": [
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"agent_id": "8f14e45f-ceea-467f-a1d1-91ad4fb0e6c4",
"agent_name": "Support Agent",
"organization_id": "0b2c1d3e-4f56-4789-9abc-def012345678",
"caller_number": "+14155550100",
"callee_number": "+919876543210",
"caller_name": "Jane Doe",
"caller_email": "jane@example.com",
"channel": "phone",
"status": "completed",
"summary": "Customer asked about billing.",
"recording_url": "https://api.example.com/api/v1/calling/sessions/550e8400-e29b-41d4-a716-446655440000/recording",
"duration_sec": 250,
"cost_total": "12.50",
"twilio_cost": 5.1,
"model_cost": 4.2,
"credit_breakdown": {
"model_credits": 4.2,
"provider_credits": 5.1,
"telephony_base_credits": 4.0
},
"disconnect_reason": "user_hangup",
"call_latency_ms": 820,
"error_message": "",
"post_call_analysis_result": {
"sentiment": "positive"
},
"metadata": {
"source": "crm"
},
"started_at": "2026-06-11T09:30:00Z",
"ended_at": "2026-06-11T09:34:10Z",
"created_at": "2026-06-11T09:29:58Z",
"transcripts": [
{
"id": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
"call_session_id": "550e8400-e29b-41d4-a716-446655440000",
"message": {
"role": "agent",
"content": "Hello!"
},
"timestamp_ms": 1765437000123,
"created_at": "2026-06-11T09:30:01Z"
}
]
}
]
}
Authorizations
BearerAuthX-Api-Key
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Query Parameters
Phone number in E.164 format. Example: +1234567890.
Page number. Defaults to 1.
Results per page. Defaults to 20. Maximum 100.
Required range:
x <= 100Set to true to include transcripts in each call result.
⌘I

