Introduction
The DispatchAI API provides real-time emergency call processing, transcription, risk analysis, and dispatch queue management. The API is built with FastAPI and supports both HTTP REST endpoints and WebSocket connections for live audio streaming.Base URL
Authentication
Currently, the API is designed for internal use and does not require authentication headers. External integrations with Telnyx and Deepgram use API keys stored as environment variables.Required Environment Variables
API key for Telnyx telephony service
API key for Deepgram speech-to-text service
Public WebSocket URL for audio streaming (e.g.,
wss://your-domain.com/ws)Application environment (
dev or prod)Response Format
All API responses are JSON-formatted. The API uses standard HTTP status codes:200- Success404- Resource not found400- Bad request500- Internal server error
Core Concepts
Call Lifecycle
- Incoming Call: Telnyx webhook triggers
POST /api/v1/call/incoming - Call Initiated: System answers call and starts audio streaming
- Live Processing: Audio streams via WebSocket, real-time transcription
- Call Hangup: Final analysis generates risk assessment and queue item
- Dispatch Queue: Call appears in queue for dispatcher action
Risk Levels
Calls are automatically classified into risk levels:CRITICAL- Immediate life-threatening emergencyELEVATED- Serious but not immediately life-threateningNORMAL- Standard emergency response neededLOW- Non-urgent or informational
Queue Status
Queue items progress through the following statuses:OPEN- New call awaiting dispatcher reviewIN_PROGRESS- Dispatcher is handling the callDISPATCHED- Emergency services dispatchedRESOLVED- Call handled and closedCANCELLED- Call cancelled or invalid
Service Categories
Calls are classified into emergency service types:EMS- Emergency Medical ServicesFIRE- Fire departmentPOLICE- Law enforcementOTHER- Other services or unclear