Skip to content
Console
Menu

Queues

Workflows

Getting Started

Authentication

KV Store

Open stream on a lease

Opens a read-only live view of a lease's display: a short-lived viewer token bound to the lease and its generation, an embeddable URL, and…

Opens a read-only live view of a lease's display: a short-lived viewer token bound to the lease and its generation, an embeddable URL, and the WebRTC signaling endpoint with ICE servers. Input needs control (AcquireLeaseControl).

  • Path POST https://api.sylphx.com/v1/orgs/acme/projects/shop/envs/production/leases/lease:openStream
  • Scope sandboxes:exec
  • Effect write — a successful call changes state.
  • Collection leases

#Request

FieldTypeWhat it is
namestringThe name of the lease. Required.
ttldurationHow long the token admits a new connection; at most and default 5 minutes. A connected stream ends when the lease generation changes or the token is revoked.

#Response

FieldTypeWhat it is
roleStreamRoleVIEWER (frames) or CONTROLLER (frames and input). One of viewer, controller.
tokenstringThe stream token. Never returned again.
viewer_uristringAn embeddable page (web, Telegram Mini App webview) that connects on load; the token rides in the URL fragment and never reaches a server log. Never returned again.
signaling_uristringThe WebRTC signaling WebSocket; send the token as the first message.
ice_serversIceServer[]ICE servers, TURN credentials included, valid until expire_time.
vnc_uristringThe noVNC/websockify fallback WebSocket for networks that block WebRTC.
expire_timetimestampWhen the token stops admitting new connections.
lease_generationint64The lease generation the token is bound to.
control_epochint64For CONTROLLER: the control epoch the token is bound to.
revoke_uristringRevokes the token early: POST it with the token as bearer.

#IceServer

FieldTypeWhat it is
urlsstring[]stun:, turn:, or turns: URLs.
usernamestringThe TURN username.
credentialstringThe TURN credential. Never returned again.

#Errors

Every error arrives in the body Errors describes.

#Examples

curl -X POST "https://api.sylphx.com/v1/orgs/acme/projects/shop/envs/production/leases/lease:openStream" \
  -H "Authorization: Bearer $SYLPHX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'