Skip to main content
POST
Requires version 1.1.5 or later of the Archetype platform.

Overview

This endpoint creates and allocates a new lens session that can process sensor data streams. Each session is associated with a specific lens and returns a unique session ID and endpoint for real-time data streaming.

Request

string
required
The ID of the lens to use for this session. Get available lens IDs from /lens/metadata

Response

The response contains an api_key field that echoes back the caller’s real API key. Treat this field as a secret — do not log, persist, or expose it in client-side code.
string
Unique identifier for the created session.
string
The lens ID associated with this session.
string
Name of the lens associated with this session.
string
Organization identifier the session belongs to.
string
The caller’s API key, echoed back for downstream WebSocket auth. Sensitive — see warning above.
string
WebSocket URL for streaming data to/from the session.
string
Initial status of the session (typically LensSessionStatus.SESSION_STATUS_REGISTERED).
integer
Maximum session lifetime in seconds (default 86400, i.e. 24 hours of inactivity).
string
Identifier of the backend runner hosting the session.
object
Resolved lens configuration in use for this session.
float
Unix timestamp when the session record was created.
float
Unix timestamp of the last event processed by the session.
float
Unix timestamp of the last update to the session record.
float
Unix timestamp when the session began running. null until the runner starts.
float
Unix timestamp when the session was destroyed. null while active.
string
Identifier of the configured input stream, or null if none is set.
string
Identifier of the configured output stream, or null if none is set.
integer
Number of active client connections to the session.
integer
Total number of events processed by the session.
integer
Number of state updates the session has emitted.
integer
Number of input frames/records the session has received.
integer
Number of outputs the session has produced.
string
Tag of the runner node the session is bound to.
array
Array of error messages if the request failed (check for this field to detect errors).

Important Notes

  • Sessions remain active until explicitly destroyed or timeout after no sensor activity
  • Always destroy sessions when done to free up resources
  • Check which sessions are running via /lens/sessions/metadata