Console / API reference
API version v2 Operator console

Developer reference

Camera stream API

The gateway exposes read-only registry data, a challenge/token exchange for operators, and standards-based WHEP playback. All endpoints share the same origin and TLS listener on port 443.

Origin localhost
Gateway release loading…
Public state loading…
Media transport SRTP / DTLS · TCP 443

Ingest and playback model

Cameras publish RTSP, SRT, or WHIP into a regional gateway. The relay rewrites the stream into a WHEP session for browser playback. Public callers can enumerate advertised streams and request a token, but media subscriptions are refused until a valid bearer token is presented.

GET /api/v2/portal.json

Returns the gateway inventory, transport summary, and the endpoint map used by the portal.

{
  "product": "Sightline Relay",
  "api_version": "v2",
  "poll_interval_seconds": 8,
  "endpoints": {
    "challenge": "/api/v2/auth/challenge.json",
    "token": "/api/v2/auth/token",
    "whep": "/whep/endpoint"
  }
}
GET /api/v2/streams/sessions.json

Public sample of active camera sessions. The overview page polls this resource every eight seconds and renders the returned gateway, codec, bitrate, and viewer counts.

curl https://<gateway-host>/api/v2/streams/sessions.json

        
GET /api/v2/auth/challenge.json

Issues a short-lived nonce for the token proof. The console fetches this resource before every sign-in attempt and binds the proof to the selected camera stream.

{
  "challenge_id": "chl_01JQ8Z4T7K9M2C",
  "nonce": "5f3a9c1e7b2d8460a1c4e8f2d6b39057",
  "algorithm": "SHA-256",
  "expires_in_seconds": 120,
  "token_endpoint": "/api/v2/auth/token"
}
POST /api/v2/auth/token

Exchanges a signed client proof for a scoped playback token. The public edge rejects unsigned requests with a JSON error and a correlation header.

POST /api/v2/auth/token
Content-Type: application/json
X-Correlation-Id: SGL-7F2A-104829

{
  "operator": "operator@example.com",
  "gateway": "edge-nyc-3",
  "stream_id": "cam-ny-014",
  "challenge_id": "chl_01JQ8Z4T7K9M2C",
  "client_proof_sha256": "<64 hex characters>",
  "requested_scope": "whep:play"
}

        
POST /whep/endpoint

Creates a WHEP playback session. The request body is an SDP offer with application/sdp; the response would normally be an SDP answer. On this public node the endpoint returns an authorization error until a token is presented.

POST /whep/endpoint
Content-Type: application/sdp
Authorization: Bearer <scoped-token>

v=0
o=- 74219831 2 IN IP4 0.0.0.0
s=Sightline Relay / cam-ny-014
t=0 0
m=video 9 UDP/TLS/RTP/SAVPF 96
a=recvonly
a=rtcp-mux
a=rtpmap:96 H264/90000

        

Error envelope

All JSON endpoints return a stable error object with an error code, a human-readable description, and the request identifier echoed in the X-Request-Id response header.

HTTP/1.1 401 Unauthorized
Content-Type: application/json
WWW-Authenticate: Bearer realm="sightline-whep", error="invalid_token"
X-Request-Id: 8f2c1a9d4b7e0356

{
  "error": "invalid_token",
  "error_description": "WHEP session creation requires a valid bearer token.",
  "request_id": "8f2c1a9d4b7e0356"
}