Calls Endpoint
Retrieve and manage emergency call data stored in DynamoDB and S3 for access911.
Endpoint
Request
| Header | Type | Required | Description |
|---|
Accept | string | No | application/json |
Query Parameters
| Parameter | Type | Required | Default | Description |
|---|
limit | integer | No | 50 | Maximum number of calls to return (1-1000) |
offset | integer | No | 0 | Number of calls to skip |
emergency_type | string | No | - | Filter by emergency type |
severity | string | No | - | Filter by severity level |
status | string | No | - | Filter by call status |
start_date | string | No | - | Start date filter (ISO 8601) |
end_date | string | No | - | End date filter (ISO 8601) |
location | string | No | - | Filter by location area |
simulation | boolean | No | - | Filter by simulation status |
Request Examples
Get Recent Calls
Filter by Emergency Type
Filter by Severity
Date Range Filter
Complex Filter
Response
Success Response
Error Response
Response Fields
| Field | Type | Description |
|---|
calls | array | Array of emergency call objects |
pagination | object | Pagination information |
pagination.limit | integer | Maximum number of calls returned |
pagination.offset | integer | Number of calls skipped |
pagination.total | integer | Total number of calls matching filters |
pagination.has_more | boolean | Whether more calls are available |
filters | object | Applied filters for reference |
Call Object Structure
| Field | Type | Description |
|---|
conversation_id | string | Unique conversation identifier |
timestamp | integer | Unix timestamp of the call |
agent_id | string | ElevenLabs agent identifier |
summary | string | Summary of the emergency call |
call_successful | boolean | Whether the call was successful |
duration_secs | integer | Call duration in seconds |
transcript_length | integer | Number of transcript turns |
created_at | string | ISO 8601 timestamp of record creation |
emergency_type | string | Type of emergency |
location | string | Location description |
latitude | number | Latitude coordinate |
longitude | number | Longitude coordinate |
severity | string | Emergency severity level |
status | string | Current call status |
simulation | boolean | Whether this is a simulated call |
scenario | string | Simulation scenario (if applicable) |
scenario_name | string | Human-readable scenario name |
HTTP Status Codes
| Code | Description |
|---|
200 | Success - Calls retrieved successfully |
400 | Bad Request - Invalid query parameters |
500 | Internal Server Error - Server error during processing |
Filter Options
Emergency Types
| Value | Description |
|---|
structure_fire | Structure fire emergency |
evacuation_assistance | Evacuation assistance needed |
trapped_person | Person trapped in emergency |
medical_emergency | Medical emergency |
shelter_information | Shelter information request |
flooding | Flooding emergency |
wind_damage | Wind damage emergency |
power_outage | Power outage emergency |
evacuation_needed | Evacuation needed |
building_collapse | Building collapse |
gas_leak | Gas leak emergency |
debris_injury | Debris-related injury |
building_damage | Building damage |
vehicle_accident | Vehicle accident |
Severity Levels
| Value | Description |
|---|
critical | Critical emergency requiring immediate response |
high | High-priority emergency |
moderate | Moderate-priority emergency |
Status Values
| Value | Description |
|---|
active | Call is active and being processed |
dispatched | Emergency services have been dispatched |
enroute | Emergency services are en route |
resolved | Emergency has been resolved |
failed | Call processing failed |
The API supports pagination for large result sets:
- limit: Maximum number of calls to return (1-1000)
- offset: Number of calls to skip from the beginning
Sorting
Calls are returned in descending order by timestamp (most recent first).
Error Handling
Common Errors
| Error | Description | Solution |
|---|
Invalid limit | Limit parameter out of range | Use a value between 1 and 1000 |
Invalid offset | Offset parameter is negative | Use a non-negative integer |
Invalid date format | Date parameters not in ISO 8601 format | Use ISO 8601 format (e.g., 2023-12-21T10:30:56Z) |
Database error | DynamoDB operation failed | Check AWS credentials and permissions |
Rate Limits
- Request rate: 1000 requests per minute
- Burst limit: 500 requests per minute
- Timeout: 30 seconds per request
Query Optimization
- Use Filters: Apply filters to reduce result set size
- Limit Results: Use appropriate limit values
- Avoid Large Offsets: Large offset values can be slow
Caching
The API implements caching for frequently accessed data:
- Recent Calls: Cached for 5 minutes
- Filtered Results: Cached for 2 minutes
- Count Queries: Cached for 10 minutes
Best Practices
Efficient Queries
- Use Specific Filters: Apply specific filters to reduce result sets
- Limit Results: Use appropriate limit values for your use case
- Monitor Performance: Track query performance and optimize as needed
Error Handling
- Implement Retry Logic: Retry failed requests with exponential backoff
- Handle Rate Limits: Implement proper rate limiting in your client
- Validate Parameters: Validate query parameters before sending requests
Security
- Use HTTPS: Always use HTTPS for API requests
- Validate Input: Validate all query parameters
- Handle Sensitive Data: Be careful with sensitive information in logs
SDK Examples
Python
JavaScript
Testing
Unit Testing
Integration Testing
Data Privacy: Ensure compliance with data privacy regulations when handling emergency call data. Consider data retention policies and access controls.