For the complete documentation index, see llms.txt. This page is also available as Markdown.

Event Store REST API

on-device Event Store v2 API के लिए endpoint संदर्भ, जिसमें event schemas और administration routes शामिल हैं।

Event Store एक प्रबंधित डिवाइस पर चलता है और उस डिवाइस पर पाइपलाइनों द्वारा उत्पन्न इनफ़ेरेंस इवेंट्स को संग्रहीत करता है। बेस URL है http://<device-ip>:8001, और इंटरैक्टिव Swagger दस्तावेज़ीकरण यहाँ उपलब्ध है /docs. देखें Services बेस URL, प्रमाणीकरण, और सभी ऑन-डिवाइस सेवा API द्वारा साझा किए गए त्रुटि-आकार नियमों के लिए।

v2 API camelCase इनपुट स्वीकार करता है (उदा.: base64Image, objectDetections) और snake_case प्रतिक्रियाएँ लौटाता है।

यदि API_KEY सेवा पर सेट है, तो के अलावा हर endpoint /health एक की आवश्यकता होती है X-API-Key हेडर की। देखें प्रमाणीकरण.

curl -H "X-API-Key: $EVENT_STORE_API_KEY" \
  "http://<device-ip>:8001/v2/events/latest/query?limit=5"

एक इवेंट बनाएँ

बाउंडिंग बॉक्स निर्देशांक केंद्र-आधारित निरपेक्ष पिक्सेल हैं: x और y बॉक्स का केंद्र हैं, width और height पूर्ण आयाम हैं। कॉन्फिडेंस 0.0 से 1.0 तक होता है।

सेट करें draft: true इवेंट को खुला रखने के लिए ताकि बाद में वीडियो या केवल-स्थानीय फ़ाइल जोड़ी जा सके, फिर उसे finalize करें। को छोड़ना ड्राफ्ट इवेंट को निर्माण के समय ही finalize कर देता है, इसलिए मौजूदा producers पर कोई असर नहीं पड़ता।

Create V2 Event

post
Authorizations
X-API-KeystringRequired
Body
solutionstring · max: 256 · nullableOptional
workflow_idstring · max: 256 · nullableOptional
workflow_versionstring · max: 64 · nullableOptional
inference_timestampstringRequired
device_idstring · max: 256 · nullableOptional
stream_idstring · max: 256 · nullableOptional
image_idstring · nullableOptional
event_schemastringRequired
event_dataobject · Event DataRequired
displayImagePositioninteger · nullableOptional

Index into the images list indicating which image to display by default in a UI

draftbooleanOptional

True while the event is a draft: media may still be attached, and it is not yet uploaded. A draft is protected from cleanup only while cloud upload is enabled on the service. With cloud upload off, retention and capacity cleanup can delete an unfinished draft and its attachments.

Default: false
Responses
201

Successful Response

application/json
idstring · uuidRequired
created_atstring · date-timeRequired
draftbooleanOptional

True while the event is a draft: media may still be attached, and it is not yet uploaded. A draft is protected from cleanup only while cloud upload is enabled on the service. With cloud upload off, retention and capacity cleanup can delete an unfinished draft and its attachments.

Default: false
messagestringOptionalDefault: Event created successfully
post/v2/events
POST /v2/events HTTP/1.1
Host: device-ip:8001
X-API-Key: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 774

{
  "solution": "text",
  "workflow_id": "text",
  "workflow_version": "text",
  "inference_timestamp": "text",
  "device_id": "text",
  "stream_id": "text",
  "image_id": "text",
  "event_schema": "text",
  "event_data": {},
  "custom_metadata": {
    "ANY_ADDITIONAL_PROPERTY": "text"
  },
  "images": [
    {
      "label": "text",
      "base64Image": "text",
      "inputBase64Image": "text",
      "objectDetections": [
        {
          "class": "text",
          "x": 1,
          "y": 1,
          "width": 1,
          "height": 1,
          "confidence": 1
        }
      ],
      "classifications": [
        {
          "class": "text",
          "confidence": 1
        }
      ],
      "instanceSegmentations": [
        {
          "class": "text",
          "x": 1,
          "y": 1,
          "width": 1,
          "height": 1,
          "confidence": 1,
          "points": [
            [
              1
            ]
          ]
        }
      ],
      "keypoints": [
        {
          "class": "text",
          "x": 1,
          "y": 1,
          "width": 1,
          "height": 1,
          "confidence": 1,
          "keypoints": [
            {
              "id": 1,
              "x": 1,
              "y": 1,
              "occluded": true
            }
          ]
        }
      ],
      "metadata": {
        "ANY_ADDITIONAL_PROPERTY": true
      }
    }
  ],
  "displayImagePosition": 1,
  "draft": false
}
{
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "image_ids": [
    "123e4567-e89b-12d3-a456-426614174000"
  ],
  "created_at": "2026-01-01T00:00:00.000Z",
  "draft": false,
  "message": "Event created successfully"
}

इवेंट्स क्वेरी करें

GET /v2/events समय-सीमा, स्रोत, और कस्टम मेटाडेटा के आधार पर फ़िल्टर करता है। metadata_filter लेता है key:value या key:op:value इन ऑपरेटरों के साथ eq, ne, gt, lt, gte और lte, और AND तर्क के साथ दोहराया जाता है।

प्रति-छवि metadata के माध्यम से क्वेरी योग्य नहीं है metadata_filter. केवल custom_metadata इवेंट पर ही है।

Get V2 Events

get

Get events with optional filtering. Returns every stored event, including any written by an earlier version of the service.

Authorizations
X-API-KeystringRequired
Query parameters
start_timestringOptional

ISO8601 timestamp to start from (filters by created_at)

limitinteger · min: 1 · max: 1000Optional

Maximum number of events to return

Default: 100
end_timestringOptional

ISO8601 timestamp to end at (filters by created_at)

device_idstringOptional

Filter by device_id (exact match)

event_schemastringOptional

Filter by event_schema (exact match)

workflow_idstringOptional

Filter by workflow_id (exact match)

external_idstringOptional

Filter by external_id (exact match)

related_event_idstringOptional

Filter by related_event_id (for feedback events)

sort_directionstringOptional

Sort direction: 'asc' or 'desc'

Default: desc
device_id__instringOptional

Filter by multiple device_ids (comma-separated)

event_schema__instringOptional

Filter by multiple event_schemas (comma-separated)

workflow_id__instringOptional

Filter by multiple workflow_ids (comma-separated)

external_id__instringOptional

Filter by multiple external_ids (comma-separated)

metadata_filterstring[]Optional

Filter by custom_metadata. Format: 'key:value' or 'key:op:value'. Operators: eq, ne, gt, lt, gte, lte.

Default: []
include_draftsbooleanOptional

Include draft (not yet finalized) events. Set false to see only finalized events.

Default: true
Responses
200

Successful Response

application/json
countintegerRequired
next_timestampstring · date-time · nullableOptional
get/v2/events
GET /v2/events HTTP/1.1
Host: device-ip:8001
X-API-Key: YOUR_API_KEY
Accept: */*
{
  "events": [
    {
      "id": "123e4567-e89b-12d3-a456-426614174000",
      "solution": "text",
      "workflow_id": "text",
      "workflow_version": "text",
      "inference_timestamp": "text",
      "device_id": "text",
      "stream_id": "text",
      "images": [
        {
          "file_id": "123e4567-e89b-12d3-a456-426614174000",
          "input_file_id": "123e4567-e89b-12d3-a456-426614174000",
          "label": "text",
          "object_detections": [
            {
              "class": "text",
              "x": 1,
              "y": 1,
              "width": 1,
              "height": 1,
              "confidence": 1
            }
          ],
          "classifications": [
            {
              "class": "text",
              "confidence": 1
            }
          ],
          "instance_segmentations": [
            {
              "class": "text",
              "x": 1,
              "y": 1,
              "width": 1,
              "height": 1,
              "confidence": 1,
              "points": [
                [
                  1
                ]
              ]
            }
          ],
          "keypoints": [
            {
              "class": "text",
              "x": 1,
              "y": 1,
              "width": 1,
              "height": 1,
              "confidence": 1,
              "keypoints": [
                {
                  "id": 1,
                  "x": 1,
                  "y": 1,
                  "occluded": true
                }
              ]
            }
          ],
          "metadata": {}
        }
      ],
      "videos": [
        {
          "file_id": "123e4567-e89b-12d3-a456-426614174000",
          "label": "text",
          "content_type": "text",
          "size_bytes": 1
        }
      ],
      "local_only_files": [
        {
          "file_id": "123e4567-e89b-12d3-a456-426614174000",
          "label": "text",
          "content_type": "text",
          "size_bytes": 1
        }
      ],
      "display_image_position": 1,
      "event_schema": "text",
      "event_data": {},
      "custom_metadata": {},
      "created_at": "2026-01-01T00:00:00.000Z",
      "api_version": "v2",
      "original_file_count": 0,
      "current_file_count": 0,
      "draft": false,
      "finalized_at": "2026-01-01T00:00:00.000Z",
      "auto_finalized_at": "2026-01-01T00:00:00.000Z"
    }
  ],
  "count": 1,
  "next_timestamp": "2026-01-01T00:00:00.000Z"
}

Get V2 Event By Id

get

Get a specific event by ID. Returns every stored event, including any written by an earlier version of the service.

Authorizations
X-API-KeystringRequired
Path parameters
event_idstring · uuidRequired
Responses
200

Successful Response

application/json
idstring · uuidRequired
solutionstring · nullableOptional
workflow_idstring · nullableOptional
workflow_versionstring · nullableOptional
inference_timestampstringRequired
device_idstring · nullableOptional
stream_idstring · nullableOptional
display_image_positioninteger · nullableOptional
event_schemastringRequired
event_dataobject · Event DataRequired
custom_metadataobject · Custom Metadata · nullableOptional
created_atstring · date-timeRequired
api_versionstringOptionalDefault: v2
original_file_countintegerOptionalDefault: 0
current_file_countintegerOptionalDefault: 0
draftbooleanOptional

True while the event is a draft: media may still be attached, and it is not yet uploaded. A draft is protected from cleanup only while cloud upload is enabled on the service. With cloud upload off, retention and capacity cleanup can delete an unfinished draft and its attachments.

Default: false
finalized_atstring · date-time · nullableOptional

When the event was finalized (null while draft)

auto_finalized_atstring · date-time · nullableOptional

Set when the event was force-finalized by the DRAFT_AUTO_FINALIZE_SECONDS sweep

get/v2/events/{event_id}
GET /v2/events/{event_id} HTTP/1.1
Host: device-ip:8001
X-API-Key: YOUR_API_KEY
Accept: */*
{
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "solution": "text",
  "workflow_id": "text",
  "workflow_version": "text",
  "inference_timestamp": "text",
  "device_id": "text",
  "stream_id": "text",
  "images": [
    {
      "file_id": "123e4567-e89b-12d3-a456-426614174000",
      "input_file_id": "123e4567-e89b-12d3-a456-426614174000",
      "label": "text",
      "object_detections": [
        {
          "class": "text",
          "x": 1,
          "y": 1,
          "width": 1,
          "height": 1,
          "confidence": 1
        }
      ],
      "classifications": [
        {
          "class": "text",
          "confidence": 1
        }
      ],
      "instance_segmentations": [
        {
          "class": "text",
          "x": 1,
          "y": 1,
          "width": 1,
          "height": 1,
          "confidence": 1,
          "points": [
            [
              1
            ]
          ]
        }
      ],
      "keypoints": [
        {
          "class": "text",
          "x": 1,
          "y": 1,
          "width": 1,
          "height": 1,
          "confidence": 1,
          "keypoints": [
            {
              "id": 1,
              "x": 1,
              "y": 1,
              "occluded": true
            }
          ]
        }
      ],
      "metadata": {}
    }
  ],
  "videos": [
    {
      "file_id": "123e4567-e89b-12d3-a456-426614174000",
      "label": "text",
      "content_type": "text",
      "size_bytes": 1
    }
  ],
  "local_only_files": [
    {
      "file_id": "123e4567-e89b-12d3-a456-426614174000",
      "label": "text",
      "content_type": "text",
      "size_bytes": 1
    }
  ],
  "display_image_position": 1,
  "event_schema": "text",
  "event_data": {},
  "custom_metadata": {},
  "created_at": "2026-01-01T00:00:00.000Z",
  "api_version": "v2",
  "original_file_count": 0,
  "current_file_count": 0,
  "draft": false,
  "finalized_at": "2026-01-01T00:00:00.000Z",
  "auto_finalized_at": "2026-01-01T00:00:00.000Z"
}

Get Latest V2 Events

get

Get the most recent events, no timestamp required. Returns every stored event, including any written by an earlier version of the service.

Authorizations
X-API-KeystringRequired
Query parameters
limitinteger · min: 1 · max: 1000Optional

Maximum number of events to return

Default: 100
include_draftsbooleanOptional

Include draft (not yet finalized) events. Set false to see only finalized events.

Default: true
Responses
200

Successful Response

application/json
countintegerRequired
next_timestampstring · date-time · nullableOptional
get/v2/events/latest/query
GET /v2/events/latest/query HTTP/1.1
Host: device-ip:8001
X-API-Key: YOUR_API_KEY
Accept: */*
{
  "events": [
    {
      "id": "123e4567-e89b-12d3-a456-426614174000",
      "solution": "text",
      "workflow_id": "text",
      "workflow_version": "text",
      "inference_timestamp": "text",
      "device_id": "text",
      "stream_id": "text",
      "images": [
        {
          "file_id": "123e4567-e89b-12d3-a456-426614174000",
          "input_file_id": "123e4567-e89b-12d3-a456-426614174000",
          "label": "text",
          "object_detections": [
            {
              "class": "text",
              "x": 1,
              "y": 1,
              "width": 1,
              "height": 1,
              "confidence": 1
            }
          ],
          "classifications": [
            {
              "class": "text",
              "confidence": 1
            }
          ],
          "instance_segmentations": [
            {
              "class": "text",
              "x": 1,
              "y": 1,
              "width": 1,
              "height": 1,
              "confidence": 1,
              "points": [
                [
                  1
                ]
              ]
            }
          ],
          "keypoints": [
            {
              "class": "text",
              "x": 1,
              "y": 1,
              "width": 1,
              "height": 1,
              "confidence": 1,
              "keypoints": [
                {
                  "id": 1,
                  "x": 1,
                  "y": 1,
                  "occluded": true
                }
              ]
            }
          ],
          "metadata": {}
        }
      ],
      "videos": [
        {
          "file_id": "123e4567-e89b-12d3-a456-426614174000",
          "label": "text",
          "content_type": "text",
          "size_bytes": 1
        }
      ],
      "local_only_files": [
        {
          "file_id": "123e4567-e89b-12d3-a456-426614174000",
          "label": "text",
          "content_type": "text",
          "size_bytes": 1
        }
      ],
      "display_image_position": 1,
      "event_schema": "text",
      "event_data": {},
      "custom_metadata": {},
      "created_at": "2026-01-01T00:00:00.000Z",
      "api_version": "v2",
      "original_file_count": 0,
      "current_file_count": 0,
      "draft": false,
      "finalized_at": "2026-01-01T00:00:00.000Z",
      "auto_finalized_at": "2026-01-01T00:00:00.000Z"
    }
  ],
  "count": 1,
  "next_timestamp": "2026-01-01T00:00:00.000Z"
}

Get Event Count

get

Get event count and statistics

Authorizations
X-API-KeystringRequired
Query parameters
device_idstringOptional

Filter by device_id

event_schemastringOptional

Filter by event_schema

workflow_idstringOptional

Filter by workflow_id

Responses
200

Successful Response

application/json

Event count and statistics response

total_countintegerRequired

Total number of events

filtered_countintegerRequired

Number of events matching filters

oldest_timestampstring · nullableOptional

Timestamp of oldest event (ISO8601)

newest_timestampstring · nullableOptional

Timestamp of newest event (ISO8601)

get/events/count/stats
GET /events/count/stats HTTP/1.1
Host: device-ip:8001
X-API-Key: YOUR_API_KEY
Accept: */*
{
  "total_count": 1,
  "filtered_count": 1,
  "oldest_timestamp": "text",
  "newest_timestamp": "text"
}

ड्राफ्ट जीवनचक्र

एक producer जिसे pass/fail निर्णय के बाद एन्कोड किया गया वीडियो जोड़ना होता है, वह इवेंट को ड्राफ्ट के रूप में बनाता है, फ़ाइल तैयार होने पर अपलोड करता है, फिर उसे finalize करता है:

जब तक कोई इवेंट finalized नहीं होता, cloud upload उसे छोड़ देता है। यह cleanup से भी सुरक्षित रहता है, लेकिन केवल तब जब सेवा पर cloud upload सक्षम हो। Cloud upload बंद होने पर, ड्राफ्ट किसी भी अन्य रिकॉर्ड जितना ही deletable होता है, इसलिए retention और capacity cleanup उस इवेंट को हटा सकते हैं जो अभी भी तैयार किया जा रहा हो।

जिस ड्राफ्ट का producer कभी finalize नहीं करता, उसे के बाद force-closed कर दिया जाता है DRAFT_AUTO_FINALIZE_SECONDS. दोनों finalized_at और auto_finalized_at उस स्थिति में सेट हो जाते हैं, इसलिए पढ़ें auto_finalized_at ताकि force-closed इवेंट और producer द्वारा स्वयं finalize किए गए इवेंट में अंतर किया जा सके।

अटैचमेंट routes बाइट्स जोड़ते हैं, इसलिए finalize के विपरीत वे capacity backpressure के अधीन होते हैं: जब store अपनी सीमाओं से ऊपर होता है, तो वे लौटाते हैं 529 और अपलोड स्वीकार नहीं किया जाता।

Upload Video To Event

post

Attach a video to a draft event.

The event must have been created with draft=true and not yet finalized - finalized events may already be in the cloud upload queue, so a late-attached video would silently never be backed up (409). The upload is multipart/form-data (no base64 overhead), parsed as a stream: the body is written straight to a staging file with MAX_VIDEO_UPLOAD_BYTES enforced per chunk, so an oversized (or misdirected) upload is rejected without ever spooling the full body to disk or memory, and the draft check runs before the body is consumed at all. The file must be a recognized video format (detected from content, not the declared content type).

Attached videos are served locally via GET /videos/{file_id} and appear in the event's videos array on the v2 GET endpoints.

Authorizations
X-API-KeystringRequired
Path parameters
event_idstring · uuidRequired
Body
filestring · binaryRequired

Video file

labelstring · max: 256Optional

Label for the video (e.g. 'camera_1_video')

Default: video
Responses
201

Successful Response

application/json
file_idstring · uuidRequired
event_idstring · uuidRequired
labelstring · nullableOptional
content_typestringRequired
size_bytesintegerRequired
messagestringOptionalDefault: Video attached successfully
post/v2/events/{event_id}/videos
POST /v2/events/{event_id}/videos HTTP/1.1
Host: device-ip:8001
X-API-Key: YOUR_API_KEY
Content-Type: multipart/form-data
Accept: */*
Content-Length: 33

{
  "file": "binary",
  "label": "video"
}
{
  "file_id": "123e4567-e89b-12d3-a456-426614174000",
  "event_id": "123e4567-e89b-12d3-a456-426614174000",
  "label": "text",
  "content_type": "text",
  "size_bytes": 1,
  "message": "Video attached successfully"
}

Upload Local Only File To Event

post

Attach a local-only file to a draft event.

Local-only files are stored on-device and are never uploaded to the cloud - regardless of content type (they may be inspection blobs, JSON, or thumbnails). This is the explicit, first-class alternative to smuggling large non-queryable payloads through queryable metadata fields.

Like video attach, the event must have been created with draft=true and not yet finalized (409 otherwise), and the body is streamed to a staging file with max_local_only_file_upload_bytes enforced per chunk so an oversized upload is rejected without ever spooling the full body to memory or disk. Unlike video attach, no content type is enforced; the client may declare a content_type or let it be sniffed from the bytes.

Attached files are served locally via GET /local-only-files/{file_id} and appear in the event's local_only_files array on the v2 GET endpoints.

Authorizations
X-API-KeystringRequired
Path parameters
event_idstring · uuidRequired
Body
filestring · binaryRequired

Arbitrary file to store on-device only (never backed up)

labelstring · max: 256Optional

Label for the file (e.g. 'inspection_blob')

Default: file
content_typestring · max: 128Optional

Optional MIME type to store and serve the file with (e.g. 'application/json'). If omitted, the type is sniffed from the file content.

Responses
201

Successful Response

application/json
file_idstring · uuidRequired
event_idstring · uuidRequired
labelstring · nullableOptional
content_typestringRequired
size_bytesintegerRequired
messagestringOptionalDefault: Local-only file attached successfully
post/v2/events/{event_id}/local-only-files
POST /v2/events/{event_id}/local-only-files HTTP/1.1
Host: device-ip:8001
X-API-Key: YOUR_API_KEY
Content-Type: multipart/form-data
Accept: */*
Content-Length: 54

{
  "file": "binary",
  "label": "file",
  "content_type": "text"
}
{
  "file_id": "123e4567-e89b-12d3-a456-426614174000",
  "event_id": "123e4567-e89b-12d3-a456-426614174000",
  "label": "text",
  "content_type": "text",
  "size_bytes": 1,
  "message": "Local-only file attached successfully"
}

Finalize V2 Event

post

Finalize a draft event so it enters the upload/cleanup lifecycle.

Idempotent: finalizing an already-finalized event is a no-op that returns the existing state (already_finalized=true). If the event was already force-closed by the DRAFT_AUTO_FINALIZE_SECONDS sweep, auto_finalized_at is set in the response.

This endpoint stays available while the device is capacity-blocked (529) because finalizing drafts is how a draft-saturated store starts draining.

Authorizations
X-API-KeystringRequired
Path parameters
event_idstring · uuidRequired
Responses
200

Successful Response

application/json
idstring · uuidRequired
finalized_atstring · date-timeRequired
already_finalizedbooleanRequired

True when the event was already finalized before this call (no-op)

auto_finalized_atstring · date-time · nullableOptional

Set when the event had already been force-finalized by the auto-finalize sweep

messagestringOptionalDefault: Event finalized
post/v2/events/{event_id}/finalize
POST /v2/events/{event_id}/finalize HTTP/1.1
Host: device-ip:8001
X-API-Key: YOUR_API_KEY
Accept: */*
{
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "finalized_at": "2026-01-01T00:00:00.000Z",
  "already_finalized": true,
  "auto_finalized_at": "2026-01-01T00:00:00.000Z",
  "message": "Event finalized"
}

इवेंट स्कीमा

event_schema की संरचना चुनता है event_data. प्रत्येक स्कीमा उन फ़ील्ड्स को निषिद्ध करता है जिन्हें वह परिभाषित नहीं करता, और हर फ़ील्ड अपने camelCase और snake_case दोनों वर्तनी स्वीकार करता है।

दोनों फ़ील्ड अलग-अलग तरीके से विफल होते हैं। एक खराब event_schema लौटाता है 422. एक event_data पेलोड जो निर्दिष्ट स्कीमा के अनुरूप नहीं है, लौटाता है 400, और एक स्ट्रिंग के साथ detail जो स्कीमा का नाम बताती है।

फ़ील्ड
प्रकार
आवश्यक
सीमा

result

"pass" या "fail"

हाँ

externalId

string

नहीं

अधिकतम 1000 वर्ण

फ़ील्ड
प्रकार
आवश्यक
सीमा

location

string

नहीं

अधिकतम 1000 वर्ण

itemCount

integer

नहीं

0 या उससे अधिक

itemType

string

नहीं

अधिकतम 1000 वर्ण

externalId

string

नहीं

अधिकतम 1000 वर्ण

फ़ील्ड
प्रकार
आवश्यक
सीमा

alertType

string

नहीं

अधिकतम 256 वर्ण, केवल अक्षर, संख्याएँ, अंडरस्कोर, स्पेस, और हाइफ़न

severity

"low", "medium"या "high"

नहीं

description

string

नहीं

अधिकतम 10000 वर्ण

externalId

string

नहीं

अधिकतम 1000 वर्ण

फ़ील्ड
प्रकार
आवश्यक
सीमा

relatedEventId

string

हाँ

रेट किए जा रहे इवेंट की ID

feedback

"correct", "incorrect"या "inconclusive"

हाँ

इन्हें वापस क्वेरी करने के लिए related_event_id पर फ़िल्टर करें GET /v2/events.

फ़ील्ड
प्रकार
आवश्यक
सीमा

externalId

string

नहीं

अधिकतम 1000 वर्ण

value

string

नहीं

अधिकतम 10000 वर्ण

जो संरचित डेटा इन फ़ील्ड्स में फ़िट नहीं होता, उसके लिए उपयोग करें custom_metadata इवेंट पर, जो क्वेरी योग्य है, या प्रति-छवि metadata, जो क्वेरी योग्य नहीं है।

फ़ाइलें डाउनलोड करें

छवि IDs अस्थायी होती हैं। Cleanup किसी भी समय फ़ाइल हटा सकता है, इसलिए इन्हें संभालें 404 और IDs को एक ही सत्र से आगे cache न करें। तुलना करें current_file_count के विरुद्ध original_file_count किसी इवेंट पर यह जानने के लिए कि उसकी फ़ाइलें साफ़ की गई थीं या नहीं।

Get Image

get

Get an image or video by ID. Supports HTTP Range requests for efficient video streaming.

Authorizations
X-API-KeystringRequired
Path parameters
image_idstringRequired
Header parameters
rangestring · nullableOptional

Byte range to request. Supports formats: bytes=start-end, bytes=start-, bytes=-suffix

Responses
200

Full content returned

anyOptional
get/images/{image_id}
GET /images/{image_id} HTTP/1.1
Host: device-ip:8001
X-API-Key: YOUR_API_KEY
Accept: */*

No content

Get Video

get

Get a video by ID. Supports HTTP Range requests for efficient streaming.

Returns 404 if the file exists but is not a video.

Authorizations
X-API-KeystringRequired
Path parameters
video_idstringRequired
Header parameters
rangestring · nullableOptional

Byte range to request. Supports formats: bytes=start-end, bytes=start-, bytes=-suffix

Responses
200

Full content returned

anyOptional
get/videos/{video_id}
GET /videos/{video_id} HTTP/1.1
Host: device-ip:8001
X-API-Key: YOUR_API_KEY
Accept: */*

No content

Get Local Only File

get

Get a local-only file by ID. Supports HTTP Range requests.

Local-only files are attached to a draft event via POST /v2/events/{event_id}/local-only-files and are stored on-device only - they are never uploaded to the cloud. Returns 404 if the file exists but is not a local-only file, so this route cannot be used to fetch ordinary images or videos.

Authorizations
X-API-KeystringRequired
Path parameters
file_idstringRequired
Header parameters
rangestring · nullableOptional

Byte range to request. Supports formats: bytes=start-end, bytes=start-, bytes=-suffix

Responses
200

Full content returned

anyOptional
get/local-only-files/{file_id}
GET /local-only-files/{file_id} HTTP/1.1
Host: device-ip:8001
X-API-Key: YOUR_API_KEY
Accept: */*

No content

सांख्यिकी और स्वास्थ्य

/stats वर्तमान उपयोग, सक्रिय कॉन्फ़िगरेशन, प्रत्येक सीमा के विरुद्ध क्षमता, और अगला cleanup pass क्या हटाएगा, यह रिपोर्ट करता है। इस पर अलर्ट दें capacity.storage.percent_used और capacity.records.percent_used 80% से ऊपर।

Get Stats

get

Get comprehensive statistics about events and images including capacity and cleanup predictions

Authorizations
X-API-KeystringRequired
Responses
200

Successful Response

application/json

Comprehensive statistics response

get/stats
GET /stats HTTP/1.1
Host: device-ip:8001
X-API-Key: YOUR_API_KEY
Accept: */*
{
  "current": {
    "total_events": 1,
    "total_images": 1,
    "total_storage_bytes": 1,
    "total_storage_formatted": "text",
    "oldest_event_timestamp": "text",
    "newest_event_timestamp": "text",
    "days_of_data_stored": 1,
    "time_until_oldest_data_deleted": "text",
    "draft_events": 0,
    "oldest_draft_age_seconds": 1
  },
  "configuration": {
    "data_dir": "text",
    "retention_days": 1,
    "max_records": 1,
    "max_record_size_bytes": 1,
    "max_record_size_formatted": "text",
    "max_storage_bytes": 1,
    "max_storage_formatted": "text",
    "cleanup_interval_seconds": 1
  },
  "capacity": {
    "records": {
      "used": 1,
      "limit": 1,
      "percent_used": 1
    },
    "storage": {
      "bytes_used": 1,
      "bytes_used_formatted": "text",
      "bytes_limit": 1,
      "bytes_limit_formatted": "text",
      "percent_used": 1
    },
    "averages": {
      "record_size_bytes": 1,
      "record_size_formatted": "text",
      "images_per_event": 1
    }
  },
  "next_cleanup_will_delete": {
    "retention_cutoff_timestamp": "text",
    "records_past_retention": 1,
    "files_past_retention": 1,
    "bytes_past_retention": 1,
    "bytes_past_retention_formatted": "text",
    "excess_records_over_limit": 1,
    "excess_bytes_over_limit": 1,
    "excess_bytes_formatted": "text"
  }
}

Health Check

get
Responses
200

Successful Response

application/json

Health check response

statusstringRequired

Overall health status

datastorestringRequired

Datastore health status

errorstring · nullableOptional

Error message if unhealthy

get/health
GET /health HTTP/1.1
Host: device-ip:8001
Accept: */*
200

Successful Response

{
  "status": "text",
  "datastore": "text",
  "error": "text"
}

प्रशासन

Manual Cleanup

post

Manually trigger cleanup process (bypasses normal schedule)

This endpoint allows operators to manually trigger data cleanup based on retention policies and storage limits. Useful for:

  • Freeing storage space immediately instead of waiting for scheduled cleanup
  • Testing cleanup behavior
  • Emergency capacity management

The cleanup process will:

  1. Delete records older than retention_days
  2. Delete oldest records if total exceeds max_records
  3. Delete oldest files if total storage exceeds max_storage_bytes

Returns detailed metrics about what was deleted and current storage state.

Authorizations
X-API-KeystringRequired
Responses
200

Successful Response

application/json

Manual cleanup response

triggerstringRequired

How cleanup was triggered (MANUAL or AUTOMATIC)

duration_secondsnumberRequired

How long cleanup took to run

bytes_freedintegerRequired

Total bytes freed by cleanup

messagestringRequired

Human-readable summary message

post/admin/cleanup
POST /admin/cleanup HTTP/1.1
Host: device-ip:8001
X-API-Key: YOUR_API_KEY
Accept: */*
{
  "trigger": "text",
  "duration_seconds": 1,
  "records_deleted": {
    "total": 1,
    "retention": 1,
    "overlimit": 1,
    "storage": 1
  },
  "files_deleted": {
    "total": 1,
    "retention": 1,
    "overlimit": 1,
    "storage": 1
  },
  "bytes_freed": 1,
  "before": {
    "records": 1,
    "files": 1,
    "bytes": 1
  },
  "after": {
    "records": 1,
    "files": 1,
    "bytes": 1
  },
  "consistency": {
    "ran": true,
    "dangling_db_records_removed": 1,
    "orphaned_disk_files_removed": 1
  },
  "message": "text"
}

रीसेट करने के लिए दो कॉल लगती हैं ताकि यह गलती से न हो सके। /reset/request 60 सेकंड के लिए मान्य एकल-उपयोग टोकन लौटाता है, और /reset/confirm डिलीट करता है।

Reset Request

post

Request a reset token (step 1 of 2)

Authorizations
X-API-KeystringRequired
Responses
200

Successful Response

application/json

Reset token request response

reset_tokenstringRequired

Token to use for reset confirmation

expires_in_secondsintegerRequired

Number of seconds until token expires

messagestringRequired

Instructions for using the token

post/reset/request
POST /reset/request HTTP/1.1
Host: device-ip:8001
X-API-Key: YOUR_API_KEY
Accept: */*
{
  "reset_token": "text",
  "expires_in_seconds": 1,
  "message": "text"
}

Reset Confirm

post

Confirm reset and delete all data (step 2 of 2)

Authorizations
X-API-KeystringRequired
Body
reset_tokenstringRequired
Responses
200

Successful Response

application/json

Reset confirmation response

statusstringRequired

Status of the reset operation

messagestringRequired

Confirmation message

post/reset/confirm
POST /reset/confirm HTTP/1.1
Host: device-ip:8001
X-API-Key: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 22

{
  "reset_token": "text"
}
{
  "status": "text",
  "message": "text"
}

अंतिम अपडेट

क्या यह उपयोगी था?