Skip to main content
GET
/
v1
/
calls
/
{call_id}
Get Call
curl --request GET \
  --url https://api.example.com/v1/calls/{call_id}
import requests

url = "https://api.example.com/v1/calls/{call_id}"

response = requests.get(url)

print(response.text)
const options = {method: 'GET'};

fetch('https://api.example.com/v1/calls/{call_id}', 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.example.com/v1/calls/{call_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);

$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.example.com/v1/calls/{call_id}"

req, _ := http.NewRequest("GET", url, nil)

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.example.com/v1/calls/{call_id}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.example.com/v1/calls/{call_id}")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
{
  "_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": [
    {
      "content": "<string>"
    }
  ],
  "recorded_call_audio_url": "<string>",
  "access_token": "<string>",
  "call_duration_seconds": 123,
  "call_type": "web_call"
}
{
"error": "<string>",
"message": "<string>"
}
{
"error": "<string>",
"message": "<string>"
}
{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}

Path Parameters

call_id
string
required

Response

Successful Response

call_status
enum<string>
required

Current status of the call: 'registered' for initialized calls, 'ongoing' for active calls, 'ended' for completed calls, 'error' for failed calls

Available options:
registered,
ongoing,
ended,
error
_id
string

Unique identifier for the call session, automatically generated as a MongoDB ObjectId

ai_agent_id
string | null

Identifier of the AI agent handling this call

ai_agent_name
string | null

Name of the AI agent handling this call

override_ai_agent_id
string | null

Optional identifier for an alternative AI agent handling this call

metadata
Metadata · object | null

Custom key-value pairs storing additional information about the call

pia_llm_dynamic_data
Pia Llm Dynamic Data · object | null

Dynamic data used by the AI agent during the call

call_start_time
string<date-time> | null

Timestamp when the call was initiated, in UTC

call_end_time
string<date-time> | null

Timestamp when the call was terminated, in UTC

messages
MessageItem · object[] | null

Chronological list of messages exchanged during the call

recorded_call_audio_url
string | null

URL to access the recorded audio file of the call

access_token
string | null

Security token for accessing call-related resources

call_duration_seconds
integer | null

Duration of the call in seconds

call_type
string
default:web_call

Indicates this response is for a web-based call

Allowed value: "web_call"
call_finish_reason
enum<string> | null

Detailed reason why the web call ended, if applicable

Available options:
user_ended_call,
agent_ended_call,
call_transferred,
inactivity_timeout,
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,
twilio_error,
no_audio_input,
speech_recognition_error,
pia_platform_internal_error,
unknown_error,
user_connection_failure