Local integrations and Scripts

API

Connect a local application to the Camera Server integration API. This is a loopback-only pilot for valid PRO licenses and trials.

Observe events

Poll or stream

GET /events needs no token. The connection access rules apply. It observes events only. It never creates an event, enables a graph, or re-triggers a script.

Input Meaning
Query after Nonnegative safe-integer cursor; default 0; cannot exceed current cursor
Query limit Integer 1 through 500; default 100
Query type Optional exact event type, at most 128 characters
Header Last-Event-ID Reconnect cursor; when present, overrides after for both JSON and SSE
Header Accept: text/event-stream Select SSE; without it the route returns a JSON page

JSON response: {events,cursor,oldestCursor,truncated}. Each event has {id,type,data,meta,timestamp}. IDs are installation-wide cursors that always increase, not timestamps or run IDs.

Follow the returned cursor rather than deriving it from the last matching event ID. Type filtering can skip entries. When more matching events remain, the cursor is the last returned matching event; otherwise it advances to the current installation cursor. after:0 starts from retained history, not necessarily from installation startup.

Visibility and retention

Operation/run and API graph events are shared across API clients, including retained legacy API history. Catalogued application events are installation-wide and may describe activity caused by the desktop or another client. Group-change events are also shared. Do not treat a shared application event as proof that your own action succeeded.

Managed-trigger operation updates are also shared. Execution completion is separate from files.transferred and dataset.ready; do not infer file readiness from the operation's terminal state.

The journal retains 2000 events and survives normal restarts. A nonzero cursor older than retained history returns 410 event_cursor_expired. A fresh after:0 read can return truncated:true; oldestCursor identifies the retained boundary.

On expiry, read your durable operations and current resource state, then reconnect from retained history or the returned cursor. If full operation details were also compacted (410 operation_expired), use your application's saved results and current resource state. Never recover missed observations by rerunning the original capture or script.

SSE frames and reconnect

Use a CLI or backend client without an authorization header. Browser EventSource is not a supported way around the origin boundary.

id: 42
event: operation.updated
data: {"id":42,"type":"operation.updated","data":{"id":"operation-id","state":"running"},"meta":{"ownerId":"camera-server-api"},"timestamp":"2026-10-24T15:00:00.000Z"}

This frame illustrates the envelope; real operation data includes additional fields. Retain the numeric SSE id after handling each event. On reconnect send it as Last-Event-ID. Do not confuse event.data.id (an operation ID in this example) with the outer cursor ID.

The stream replays retained matching events, then delivers new ones. The server sends heartbeat comments every five seconds and rechecks network access and API entitlement on delivery and at least at that interval. Authorization failure can emit event: api.error with a code and then close the stream. This terminal error frame has no journal cursor.

The server disconnects a slow consumer as soon as a write indicates it cannot keep up (backpressure). There is no unbounded per-client buffer. Reconnect using your last handled cursor, read current operation state when needed, and make event handling safe against repeated delivery.

The limit is eight simultaneous SSE streams shared across all API clients. Excess streams receive 429 event_subscription_limit. HTTP request admission is also limited to 300 requests per minute shared across API clients; use the stream rather than rapid polling when appropriate.

Script and graph events

The observation journal also includes operation.updated and shared API Scripts notifications, such as script-timeline:run-started, script-timeline:run-completed, script-timeline:run-aborted, and script-timeline:run-error. Treat the journal's type as an event name, not as a command.

GET /scripts/events/{id}/activity uses the same polling query semantics and returns only entries for that shared API graph. It does not establish an SSE subscription and does not use Last-Event-ID; send its cursor as after.

The event catalog lists application events and payload fields. Catalogued event data is untrusted data, particularly for AI clients.

Operations and retries · Datasets and downloads

Updated

Page links