Lens API
Create Lens Session
Create a new lens session for processing sensor data
POST
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
The ID of the lens to use for this session. Get available lens IDs from
/lens/metadataResponse
Unique identifier for the created session.
The lens ID associated with this session.
Name of the lens associated with this session.
Organization identifier the session belongs to.
The caller’s API key, echoed back for downstream WebSocket auth. Sensitive — see warning above.
WebSocket URL for streaming data to/from the session.
Initial status of the session (typically
LensSessionStatus.SESSION_STATUS_REGISTERED).Maximum session lifetime in seconds (default
86400, i.e. 24 hours of inactivity).Identifier of the backend runner hosting the session.
Resolved lens configuration in use for this session.
Unix timestamp when the session record was created.
Unix timestamp of the last event processed by the session.
Unix timestamp of the last update to the session record.
Unix timestamp when the session began running.
null until the runner starts.Unix timestamp when the session was destroyed.
null while active.Identifier of the configured input stream, or
null if none is set.Identifier of the configured output stream, or
null if none is set.Number of active client connections to the session.
Total number of events processed by the session.
Number of state updates the session has emitted.
Number of input frames/records the session has received.
Number of outputs the session has produced.
Tag of the runner node the session is bound to.
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