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

Event Store REST API

이벤트 스키마와 관리 경로를 포함한 온디바이스 Event Store v2 API의 엔드포인트 참조입니다.

Event Store는 관리형 디바이스에서 실행되며 해당 디바이스에서 파이프라인이 생성한 추론 이벤트를 저장합니다. 기본 URL은 http://<device-ip>:8001, 그리고 대화형 Swagger 문서는 다음에서 제공됩니다 /docs. 다음을 참조하세요 서비스 기본 URL, 인증, 그리고 디바이스 내 모든 서비스 API가 공유하는 오류 형식 규칙은 다음을 참조하세요.

v2 API는 camelCase 입력을 허용합니다(예: base64Image, objectDetections) 그리고 snake_case 응답을 반환합니다.

만약 API_KEY 가 서비스에 설정되어 있으면, 다음을 제외한 모든 엔드포인트는 /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 는 박스의 중심이며, 너비 그리고 높이 는 전체 크기입니다. 신뢰도는 0.0에서 1.0까지입니다.

설정 draft: true 이벤트를 열어 둔 상태로 유지해 나중에 비디오나 로컬 전용 파일을 첨부할 수 있게 한 다음, 이를 최종 확정합니다. 생략하면 draft 생성 시 이벤트가 최종 확정되므로 기존 프로듀서에는 영향이 없습니다.

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_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"
}

초안 라이프사이클

합격/불합격 결정 후 인코딩된 비디오를 첨부해야 하는 프로듀서는 이벤트를 초안으로 생성하고, 파일이 준비되면 업로드한 다음, 최종 확정합니다:

이벤트가 최종 확정되기 전까지는 클라우드 업로드에서 건너뜁니다. 또한 정리 대상에서도 보호되지만, 이는 서비스에서 클라우드 업로드가 활성화되어 있는 동안에만 그렇습니다. 클라우드 업로드가 꺼져 있으면 초안은 다른 레코드와 마찬가지로 삭제 가능하므로, 보존 및 용량 정리가 아직 작성 중인 항목도 제거할 수 있습니다.

프로듀서가 finalize를 호출하지 않는 초안은 다음 후 강제 종료됩니다 DRAFT_AUTO_FINALIZE_SECONDS. 둘 다 finalized_at 그리고 auto_finalized_at 가 그 경우에 설정되므로 auto_finalized_at 강제 종료된 이벤트와 프로듀서가 직접 최종 확정한 이벤트를 구분하려면 이를 읽으세요.

첨부 경로는 바이트를 추가하므로 finalize와 달리 용량 백프레셔의 영향을 받습니다. 저장소가 한도를 초과하면 다음을 반환합니다 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

문자열

아니요

최대 1000자

필드
형식
필수
제약

location

문자열

아니요

최대 1000자

itemCount

정수

아니요

0 이상

itemType

문자열

아니요

최대 1000자

externalId

문자열

아니요

최대 1000자

필드
형식
필수
제약

alertType

문자열

아니요

최대 256자, 문자, 숫자, 밑줄, 공백, 하이픈만 허용

severity

"low", "medium"또는 "high"

아니요

설명

문자열

아니요

최대 10000자

externalId

문자열

아니요

최대 1000자

필드
형식
필수
제약

relatedEventId

문자열

예

평가 대상 이벤트의 ID

피드백

"correct", "incorrect"또는 "inconclusive"

예

다음으로 이들을 다시 조회하세요 related_event_id 필터를 사용한 GET /v2/events.

필드
형식
필수
제약

externalId

문자열

아니요

최대 1000자

값

문자열

아니요

최대 10000자

이 필드에 맞지 않는 구조화된 데이터는 다음을 사용하세요 custom_metadata 이벤트의 다음을 사용하면 조회할 수 있으며, 또는 이미지별 메타데이터, 이는 조회할 수 없습니다.

파일 다운로드

이미지 ID는 일시적입니다. 정리 작업은 언제든 파일을 제거할 수 있으므로, 이를 처리하세요 404 하고 ID를 단일 세션 이상 캐시하지 마세요. 다음을 비교하세요 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 현재 사용량, 활성 구성, 각 한도 대비 용량, 그리고 다음 정리 작업에서 삭제될 항목을 보고합니다. 다음에 대해 알림을 설정하세요 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"
}

마지막 업데이트

도움이 되었나요?