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
| Field | Type | What it is |
|---|---|---|
name | string | The name of the lease. Required. |
ttl | duration | How 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
| Field | Type | What it is |
|---|---|---|
role | StreamRole | VIEWER (frames) or CONTROLLER (frames and input). One of viewer, controller. |
token | string | The stream token. Never returned again. |
viewer_uri | string | An 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_uri | string | The WebRTC signaling WebSocket; send the token as the first message. |
ice_servers | IceServer[] | ICE servers, TURN credentials included, valid until expire_time. |
vnc_uri | string | The noVNC/websockify fallback WebSocket for networks that block WebRTC. |
expire_time | timestamp | When the token stops admitting new connections. |
lease_generation | int64 | The lease generation the token is bound to. |
control_epoch | int64 | For CONTROLLER: the control epoch the token is bound to. |
revoke_uri | string | Revokes the token early: POST it with the token as bearer. |
IceServer
| Field | Type | What it is |
|---|---|---|
urls | string[] | stun:, turn:, or turns: URLs. |
username | string | The TURN username. |
credential | string | The TURN credential. Never returned again. |
Errors
UNAUTHENTICATED— No valid key or token was presented.PERMISSION_DENIED— The key lacks the method's permission.RESOURCE_NOT_FOUND— The named Resource does not exist or is not visible.INVALID_STATE— The Resource is in a state that forbids the call.DEVICE_LOST— The Android device is no longer online. The lease retains its machine and files until release or expiry. No new device action or execution was dispatched.
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 '{}'