API Reference
Built-in Tools
Custom Tools
Calls
Post-call Analysis
Phone Numbers
- GETRetrieve a paginated list of all phone numbers configured in your PIA Platform account
- POSTCreate a new phone number
- GETRetrieve detailed information about a specific phone number configuration
- DELRemove a phone number configuration from the PIA Platform
- PATCHUpdate the configuration of an existing phone number
Knowledge Bases
Knowledge Bases v2
Prompt Generation
Public Sharing
List Calls
Retrieve a paginated list of calls with optional filtering and sorting.
This endpoint allows querying call history with various filters including time ranges and specific AI agents. Results are paginated for efficient data retrieval.
{
"calls": [
{
"_id": "<string>",
"ai_agent_id": "<string>",
"ai_agent_name": "<string>",
"call_status": "registered",
"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>"
}
],
"recorded_call_audio_url": "<string>",
"access_token": "<string>",
"call_duration_seconds": 123,
"call_type": "web_call",
"call_finish_reason": "user_ended_call"
}
],
"next_page_token": "<string>",
"total_count": 123
}
Query Parameters
1 <= x <= 1000
Response
List of call records, can include both web and phone calls
Current status of the call: 'registered' for initialized calls, 'ongoing' for active calls, 'ended' for completed calls, 'error' for failed calls
registered
, ongoing
, ended
, error
Unique identifier for the call session, automatically generated as a MongoDB ObjectId
Identifier of the AI agent handling this call
Name of the AI agent handling this call
Optional identifier for an alternative AI agent handling this call
Custom key-value pairs storing additional information about the call
Dynamic data used by the AI agent during the call
Timestamp when the call was initiated, in UTC
Timestamp when the call was terminated, in UTC
Chronological list of messages exchanged during the call
URL to access the recorded audio file of the call
Security token for accessing call-related resources
Duration of the call in seconds
Indicates this response is for a web-based call
"web_call"
Detailed reason why the web call ended, if applicable
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
Token for retrieving the next page of results in paginated responses
Total number of calls matching the query criteria
{
"calls": [
{
"_id": "<string>",
"ai_agent_id": "<string>",
"ai_agent_name": "<string>",
"call_status": "registered",
"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>"
}
],
"recorded_call_audio_url": "<string>",
"access_token": "<string>",
"call_duration_seconds": 123,
"call_type": "web_call",
"call_finish_reason": "user_ended_call"
}
],
"next_page_token": "<string>",
"total_count": 123
}