Task Events

Create task event

Changed on
Create a new task event to track user interactions and system events during annotation.

This endpoint is designed to receive events from the frontend labeling interface to enable
accurate lead time calculation and detailed annotation analytics.

## Event Types

**Core Annotation Events:**
- `annotation_loaded` - When annotation interface is loaded
- `annotation_created` - When annotation is submitted
- `annotation_updated` - When annotation is modified
- `annotation_reviewed` - When annotation is reviewed

**User Activity Events:**
- `visibility_change` - When page visibility changes (tab switch, minimize)
- `idle_detected` - When user goes idle
- `idle_resumed` - When user returns from idle

**Interaction Events:**
- `region_finished_drawing` - When annotation region is completed
- `region_deleted` - When annotation regions are removed
- `hotkey_pressed` - When keyboard shortcuts are used

**Media Events:**
- `video_playback_start/end` - Video playback control
- `audio_playback_start/end` - Audio playback control
- `video_scrub` - Video timeline scrubbing

## Usage

Events are automatically associated with the task specified in the URL path.
The current user is automatically set as the actor. Project and organization
are derived from the task context.

## Example Request

```json
{
    "event_key": "annotation_loaded",
    "event_time": "2024-01-15T10:30:00Z",
    "annotation": 123,
    "meta": {
        "annotation_count": 5,
        "estimated_time": 300
    }
}
```
post/api/tasks/{id}/events/

Request

  • Base URL
    http://localhost:8000
  • URL
    http://localhost:8000/api/tasks/{id}/events/
  • Auth
    API key in header Authorization

Path parameters

idinteger required

Task ID to associate the event with

Request body

annotationinteger nullable

Annotation ID associated with this event

annotation_draftinteger nullable

Draft annotation ID associated with this event (alias for annotation_draft_id)

annotation_draft_idinteger nullable

Draft annotation ID associated with this event

event_keystring required

Event type identifier (e.g., "annotation_loaded", "region_finished_drawing")

event_timestring date-time required

Timestamp when the event occurred (frontend time)

metaunknown
reviewinteger nullable

Review ID associated with this event

Response

actorinteger required
annotationinteger nullable

Annotation ID associated with this event

annotation_draft_idinteger nullable

Draft annotation ID associated with this event

created_atstring date-time required
event_keystring required

Event type identifier (e.g., "annotation_loaded", "region_finished_drawing")

event_timestring date-time required

Timestamp when the event occurred (frontend time)

idinteger required
metaunknown
organizationinteger required
projectinteger required
reviewinteger nullable

Review ID associated with this event

taskinteger required

Task this event is associated with

Changes

    • info

      added the new optional request property (media type: application/json)

    • info

      added the new optional request property (media type: application/x-www-form-urlencoded)

    • info

      added the new optional request property (media type: multipart/form-data)