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 ドキュメントは次の URL で提供されます /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 は बॉックスの中心です。 width と height は全体の寸法です。信頼度は 0.0 から 1.0 までです。

設定する draft: true 動画やローカル専用ファイルを後から添付できるようにイベントを開いたままにし、その後で確定します。省略すると draft 作成時にイベントが確定されるため、既存のプロデューサーには影響ありません。

Create V2 Event

post
認可
X-API-Keystring必須
本文
solutionstring · 最大: 256 · ヌル許容オプション
workflow_idstring · 最大: 256 · ヌル許容オプション
workflow_versionstring · 最大: 64 · ヌル許容オプション
inference_timestampstring必須
device_idstring · 最大: 256 · ヌル許容オプション
stream_idstring · 最大: 256 · ヌル許容オプション
image_idstring · ヌル許容オプション
event_schemastring必須
event_dataobject · Event Data必須
displayImagePositioninteger · ヌル許容オプション

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

draftbooleanオプション

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
レスポンス
201

Successful Response

application/json
idstring · uuid必須
created_atstring · date-time必須
draftbooleanオプション

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
messagestringオプションDefault: 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.

認可
X-API-Keystring必須
クエリパラメータ
start_timestringオプション

ISO8601 timestamp to start from (filters by created_at)

limitinteger · 最小: 1 · 最大: 1000オプション

Maximum number of events to return

Default: 100
end_timestringオプション

ISO8601 timestamp to end at (filters by created_at)

device_idstringオプション

Filter by device_id (exact match)

event_schemastringオプション

Filter by event_schema (exact match)

workflow_idstringオプション

Filter by workflow_id (exact match)

external_idstringオプション

Filter by external_id (exact match)

related_event_idstringオプション

Filter by related_event_id (for feedback events)

sort_directionstringオプション

Sort direction: 'asc' or 'desc'

Default: desc
device_id__instringオプション

Filter by multiple device_ids (comma-separated)

event_schema__instringオプション

Filter by multiple event_schemas (comma-separated)

workflow_id__instringオプション

Filter by multiple workflow_ids (comma-separated)

external_id__instringオプション

Filter by multiple external_ids (comma-separated)

metadata_filterstring[]オプション

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

Default: []
include_draftsbooleanオプション

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

Default: true
レスポンス
200

Successful Response

application/json
countinteger必須
next_timestampstring · date-time · ヌル許容オプション
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.

認可
X-API-Keystring必須
パスパラメータ
event_idstring · uuid必須
レスポンス
200

Successful Response

application/json
idstring · uuid必須
solutionstring · ヌル許容オプション
workflow_idstring · ヌル許容オプション
workflow_versionstring · ヌル許容オプション
inference_timestampstring必須
device_idstring · ヌル許容オプション
stream_idstring · ヌル許容オプション
display_image_positioninteger · ヌル許容オプション
event_schemastring必須
event_dataobject · Event Data必須
custom_metadataobject · Custom Metadata · ヌル許容オプション
created_atstring · date-time必須
api_versionstringオプションDefault: v2
original_file_countintegerオプションDefault: 0
current_file_countintegerオプションDefault: 0
draftbooleanオプション

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 · ヌル許容オプション

When the event was finalized (null while draft)

auto_finalized_atstring · date-time · ヌル許容オプション

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.

認可
X-API-Keystring必須
クエリパラメータ
limitinteger · 最小: 1 · 最大: 1000オプション

Maximum number of events to return

Default: 100
include_draftsbooleanオプション

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

Default: true
レスポンス
200

Successful Response

application/json
countinteger必須
next_timestampstring · date-time · ヌル許容オプション
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

認可
X-API-Keystring必須
クエリパラメータ
device_idstringオプション

Filter by device_id

event_schemastringオプション

Filter by event_schema

workflow_idstringオプション

Filter by workflow_id

レスポンス
200

Successful Response

application/json

Event count and statistics response

total_countinteger必須

Total number of events

filtered_countinteger必須

Number of events matching filters

oldest_timestampstring · ヌル許容オプション

Timestamp of oldest event (ISO8601)

newest_timestampstring · ヌル許容オプション

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.

認可
X-API-Keystring必須
パスパラメータ
event_idstring · uuid必須
本文
filestring · binary必須

Video file

labelstring · 最大: 256オプション

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

Default: video
レスポンス
201

Successful Response

application/json
file_idstring · uuid必須
event_idstring · uuid必須
labelstring · ヌル許容オプション
content_typestring必須
size_bytesinteger必須
messagestringオプションDefault: 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.

認可
X-API-Keystring必須
パスパラメータ
event_idstring · uuid必須
本文
filestring · binary必須

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

labelstring · 最大: 256オプション

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

Default: file
content_typestring · 最大: 128オプション

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

レスポンス
201

Successful Response

application/json
file_idstring · uuid必須
event_idstring · uuid必須
labelstring · ヌル許容オプション
content_typestring必須
size_bytesinteger必須
messagestringオプションDefault: 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.

認可
X-API-Keystring必須
パスパラメータ
event_idstring · uuid必須
レスポンス
200

Successful Response

application/json
idstring · uuid必須
finalized_atstring · date-time必須
already_finalizedboolean必須

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

auto_finalized_atstring · date-time · ヌル許容オプション

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

messagestringオプションDefault: 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 の両方の表記を受け付けます。

この 2 つのフィールドは失敗の仕方が異なります。不正な event_schema 返します 422。1つの event_data ペイロードが指定されたスキーマに準拠しない場合、次を返します 400、文字列 detail でスキーマ名を示します。

フィールド
型
必須
制約

result

"pass" または "fail"

はい

externalId

文字列

いいえ

最大1000文字

フィールド
型
必須
制約

location

文字列

いいえ

最大1000文字

itemCount

整数

いいえ

0以上

itemType

文字列

いいえ

最大1000文字

externalId

文字列

いいえ

最大1000文字

フィールド
型
必須
制約

alertType

文字列

いいえ

最大256文字。使用できるのは英字、数字、アンダースコア、スペース、ハイフンのみです

severity

"low", "medium"、または "high"

いいえ

description

文字列

いいえ

最大10000文字

externalId

文字列

いいえ

最大1000文字

フィールド
型
必須
制約

relatedEventId

文字列

はい

評価対象のイベントのID

feedback

"correct", "incorrect"、または "inconclusive"

はい

これらは次で再取得できます related_event_id でフィルタする GET /v2/events.

フィールド
型
必須
制約

externalId

文字列

いいえ

最大1000文字

値

文字列

いいえ

最大10000文字

これらのフィールドに収まらない構造化データには、次を使用してください custom_metadata イベント上のクエリ可能な項目、または画像ごとの メタデータ(こちらはクエリ不可です)。

ファイルをダウンロード

画像 ID は一時的です。クリーンアップはいつでもファイルを削除できるため、適切に処理し 404 、ID は 1 セッションを超えてキャッシュしないでください。比較: current_file_count を original_file_count イベントの original_file_count と比較して、そのファイルがクリーンアップされたかどうかを判断します。

Get Image

get

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

認可
X-API-Keystring必須
パスパラメータ
image_idstring必須
ヘッダーパラメータ
rangestring · ヌル許容オプション

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

レスポンス
200

Full content returned

anyオプション
get/images/{image_id}
GET /images/{image_id} HTTP/1.1
Host: device-ip:8001
X-API-Key: YOUR_API_KEY
Accept: */*

コンテンツなし

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.

認可
X-API-Keystring必須
パスパラメータ
video_idstring必須
ヘッダーパラメータ
rangestring · ヌル許容オプション

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

レスポンス
200

Full content returned

anyオプション
get/videos/{video_id}
GET /videos/{video_id} HTTP/1.1
Host: device-ip:8001
X-API-Key: YOUR_API_KEY
Accept: */*

コンテンツなし

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.

認可
X-API-Keystring必須
パスパラメータ
file_idstring必須
ヘッダーパラメータ
rangestring · ヌル許容オプション

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

レスポンス
200

Full content returned

anyオプション
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: */*

コンテンツなし

統計とヘルス

/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

認可
X-API-Keystring必須
レスポンス
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
レスポンス
200

Successful Response

application/json

Health check response

statusstring必須

Overall health status

datastorestring必須

Datastore health status

errorstring · ヌル許容オプション

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.

認可
X-API-Keystring必須
レスポンス
200

Successful Response

application/json

Manual cleanup response

triggerstring必須

How cleanup was triggered (MANUAL or AUTOMATIC)

duration_secondsnumber必須

How long cleanup took to run

bytes_freedinteger必須

Total bytes freed by cleanup

messagestring必須

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

リセットには 2 回の呼び出しが必要なため、誤って実行されることはありません。 /reset/request 60 秒間有効な 1 回限りのトークンを返し、 /reset/confirm 削除を実行します。

Reset Request

post

Request a reset token (step 1 of 2)

認可
X-API-Keystring必須
レスポンス
200

Successful Response

application/json

Reset token request response

reset_tokenstring必須

Token to use for reset confirmation

expires_in_secondsinteger必須

Number of seconds until token expires

messagestring必須

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)

認可
X-API-Keystring必須
本文
reset_tokenstring必須
レスポンス
200

Successful Response

application/json

Reset confirmation response

statusstring必須

Status of the reset operation

messagestring必須

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

最終更新

役に立ちましたか?