Skip to content
Console
Menu

Queues

Workflows

Getting Started

Authentication

KV Store

Acquire control on a lease

Takes exclusive input control of a lease's display.

Takes exclusive input control of a lease's display. A HUMAN acquire preempts an AGENT holder and returns a controller stream; an AGENT acquire is refused CONTROL_HELD_BY_HUMAN while a human holds control. Control lapses at ttl, which the platform caps at 30 minutes.

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

#Request

FieldTypeWhat it is
namestringThe name of the lease. Required.
holderControlHolderHUMAN or AGENT. Required. One of agent, human.
ttldurationHow long; default 10 minutes, capped at 30 minutes.
holder_labelstringA label for the holder, for example the person's user id; recorded in the audit events.
preemptboolFor HUMAN: take control from another human.

#Response

FieldTypeWhat it is
controlControlStateThe control now held.
streamStreamSessionFor HUMAN: the controller stream bound to this epoch.

#ControlState

FieldTypeWhat it is
holderControlHolderWho holds control; UNSPECIFIED when nobody does (agent actions allowed). Output only. One of agent, human.
epochint64Increases on every acquire; release names it. Output only.
principalstringThe Access principal that acquired control. Output only.
holder_labelstringThe caller's label for the person or agent, for example a user id. Output only.
acquire_timetimestampWhen control was acquired. Output only.
expire_timetimestampWhen control lapses unless re-acquired. Output only.

#StreamSession

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:acquireControl" \
  -H "Authorization: Bearer $SYLPHX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"holder":"agent"}'