List Calls
Retrieve recent call records sorted by ranking
Endpoint
Description
Returns a list of recent calls (up to 100 most recent) sorted by risk ranking. This provides a historical view of all processed calls with complete analysis data.Request
No parameters required.cURL Example
Response
Returns an array of call records.Unique call identifier
Telnyx call control ID
Masked caller phone number (e.g.,
"•••1234")Emergency number that was called
Call duration in seconds
Audio analysis data
Audio sample rate (typically 8000 Hz)
Seconds of detected voice activity
Average distress score from audio analysis (0.0 to 1.0)
Maximum distress score during call
Categorical distress level:
CALM, ELEVATED, or HIGH_RISKNatural language processing results
Full call transcript
Service category:
EMS, FIRE, POLICE, or OTHERConfidence score for category classification
Array of semantic tags extracted from transcript
AI-generated summary of the call
Success Response (200 OK)
Sorting Logic
Calls are sorted by:- Ranking weight (descending)
- Risk score (descending)
- Creation timestamp (descending - newest first)
- Highest-risk calls first
- Most recent calls within same risk level
Implementation
Location:app/main.py:707-730
Usage Notes
- Returns up to 100 most recent calls (limit set by
InMemoryCallStore) - In dev mode, uses in-memory storage (lost on restart)
- In production, would use persistent database
- Response includes
Cache-Control: no-storeheader
Get Call Details
Retrieve complete details for a specific call
Endpoint
Path Parameters
The call session ID to retrieve
Request
cURL Example
Response
Call ID
Current queue status (from queue item if exists)
Audio analysis (same structure as in list response)
Risk assessment (same structure as in list response)
NLP results (same structure as in list response)
Routing recommendations (same structure as in list response)
Success Response (200 OK)
Error Response (404 Not Found)
Implementation
Location:app/main.py:814-844
Usage Notes
- Searches through recent calls in memory
- Merges call record data with queue status
- Used by UI to display detailed call view
- Returns 404 if call ID not found in recent calls