Events API
API endpoints and SDK methods for working with detected events
Events API
The Events API allows you to work with individual driving events detected in videos. This page documents both the REST API endpoints and the corresponding SDK methods.
Event Structure
Each detected event contains the following information:
Get Video Events
Retrieve events detected in a specific video.
SDK Method
HTTP Request
Headers:
Query Parameters:
firebase_collection_name
(string, required): Collection name (default: “videos”)severity
(string, optional): Filter by severity (“low”, “medium”, “high”)event_type
(string, optional): Filter by event type (“Traffic Violation”, “Safety Alert”, etc.)
Response:
Get All Events
Retrieve events across all videos, with optional filtering.
SDK Method
The current SDK doesn’t provide a direct method for this endpoint, but you can implement it by retrieving events from individual videos and combining the results.
HTTP Request
Headers:
Query Parameters:
firebase_collection_name
(string, required): Collection name (default: “videos”)severity
(string, optional): Filter by severity (“low”, “medium”, “high”)event_type
(string, optional): Filter by event type (“Traffic Violation”, “Safety Alert”, etc.)date_from
(string, optional): Filter by date range start (ISO format)date_to
(string, optional): Filter by date range end (ISO format)limit
(integer, optional): Maximum number of events to return (default: 100)offset
(integer, optional): Pagination offset (default: 0)
Response:
Get Specific Event
Retrieve a specific event by its ID.
SDK Method
The current SDK doesn’t provide a direct method for this endpoint.
HTTP Request
Headers:
Query Parameters:
firebase_collection_name
(string, required): Collection name (default: “videos”)
Response:
Get Event Thumbnail
Retrieve a thumbnail image for a specific event.
SDK Method
The current SDK doesn’t provide a direct method for this endpoint.
HTTP Request
Headers:
Query Parameters:
firebase_collection_name
(string, required): Collection name (default: “videos”)size
(string, optional): Thumbnail size (“small”, “medium”, “large”, default: “medium”)format
(string, optional): Image format (“jpg”, “png”, default: “jpg”)
Response: Binary image data with appropriate content type header.
Get Event Clip
Extract a short video clip centered around a specific event.
SDK Method
The current SDK doesn’t provide a direct method for this endpoint.
HTTP Request
Headers:
Query Parameters:
firebase_collection_name
(string, required): Collection name (default: “videos”)duration
(number, optional): Clip duration in seconds (default: 10)before_ratio
(number, optional): Portion of clip before the event (0-1, default: 0.3)format
(string, optional): Video format (“mp4”, “webm”, default: “mp4”)resolution
(string, optional): Video resolution (“original”, “720p”, “480p”, default: “720p”)
Response: Binary video data with appropriate content type header.
Similar Events
Find events similar to a specific event.
SDK Method
The current SDK doesn’t provide a direct method for this endpoint.
HTTP Request
Headers:
Query Parameters:
firebase_collection_name
(string, required): Collection name (default: “videos”)limit
(integer, optional): Maximum number of similar events to return (default: 10)min_similarity
(number, optional): Minimum similarity score (0-1, default: 0.7)search_scope
(string, optional): Search scope (“all”, “user”, default: “user”)
Response:
Update Event
Add custom information to an event.
SDK Method
The current SDK doesn’t provide a direct method for this endpoint.
HTTP Request
Headers:
Request Body:
Response:
Event Statistics
Get statistics about events across all videos.
SDK Method
The current SDK doesn’t provide a direct method for this endpoint.
HTTP Request
Headers:
Query Parameters:
firebase_collection_name
(string, required): Collection name (default: “videos”)date_from
(string, optional): Filter by date range start (ISO format)date_to
(string, optional): Filter by date range end (ISO format)
Response:
Flag Event
Report an issue with event detection.
SDK Method
The current SDK doesn’t provide a direct method for this endpoint.
HTTP Request
Headers:
Request Body:
Response:
Event Types Reference
Get a reference list of all event types and their definitions.
SDK Method
The current SDK doesn’t provide a direct method for this endpoint.
HTTP Request
Headers:
Response:
Error Handling
The Events API returns the same error structure as the other APIs:
Common error codes specific to the Events API:
event_not_found
: The requested event doesn’t existinvalid_event_parameters
: Invalid parameters for event operationclip_generation_failed
: Failed to generate event clipthumbnail_generation_failed
: Failed to generate event thumbnail