Troupeby AliveDocsSign in

Reference

sessions

Device acquisition: a session holds one device until it is released or expires. Index · shared schemas · errors.

ProcedureSummaryRESTMCP toolStability
sessions.createAcquire a device matching a spec. It returns at once: ready for a warm local device, otherwise starting or queued. Requested installs run inside starting, outside test timeouts. install additionally requires apps:install.POSTsessions_createstable
sessions.getRead one sessionGETsessions_getstable
sessions.listList the caller's visible sessionsGETsessions_liststable
sessions.waitWait until ready (or terminal) or until timeoutMs. until: 'stream' is done once the session's stream can be opened (streamReadyAt set), at ready or before it, or once it is terminal. A timeout is a normal result, never an error.GETsessions_waitstable
sessions.heartbeatExtend liveness. Required for test-worker; a keepalive for other holders.POSTsessions_heartbeatstable
sessions.releaseEnd a session: canceled before ready, ended(released) after. The device returns warm, or is recycled when healthy is false. Releasing an ended session returns it unchanged.POSTsessions_releasestable
sessions.eventsA session's events: status, app state, crashes, input state and stream readinessGET—stable

sessions.create

Acquire a device matching a spec. It returns at once: ready for a warm local device, otherwise starting or queued. Requested installs run inside starting, outside test timeouts. install additionally requires apps:install.

RESTPOST /v1/sessions/create (input as a JSON body)
RPC/rpc/v2/sessions/create
MCPtool sessions_create; hints: none
Authdevices:acquire
Tenancyproject
Troupe Cloudanswered by the control plane
Stabilitystable, since 1.0

Input:

TypeScript
{
  spec: DeviceSpec
  holder?: SessionCreateHolder
  key?: string  // 1–128 chars
  install?: AppSource[]  // ≤ 5 items
  idleTimeoutMs?: DurationMs
  maxDurationMs?: DurationMs
  fresh?: boolean
}

Output:

TypeScript
Session

Errors: U, E, CAPACITY_UNAVAILABLE, QUOTA_EXCEEDED, DEVICE_SPEC_INVALID, CAPABILITY_UNSUPPORTED, CONFLICT, ORG_SUSPENDED, PROJECT_SUSPENDED, SERVICE_SUSPENDED, PROJECT_REQUIRED.

Named types: AppSource, DeviceSpec, DurationMs, Session, SessionCreateHolder.

sessions.get

Read one session

RESTGET /v1/sessions/get (input as query parameters)
RPC/rpc/v2/sessions/get
MCPtool sessions_get; hints: read-only, idempotent
Authdevices:read
Tenancyproject
Troupe Cloudanswered by the control plane
Stabilitystable, since 1.0

Input:

TypeScript
{ sessionId: SessionId }

Output:

TypeScript
Session

Errors: U, NOT_FOUND.

Named types: Session, SessionId.

sessions.list

List the caller's visible sessions

RESTGET /v1/sessions/list (input as query parameters)
RPC/rpc/v2/sessions/list
MCPtool sessions_list; hints: read-only, idempotent
Authdevices:read
Tenancyproject
Troupe Cloudanswered by the control plane
Stabilitystable, since 1.0

Input:

TypeScript
{
  status?: 'live' | 'terminal' | 'all'  // default 'live'
  holderKind?: HolderKind
  limit?: integer  // default 50; 1–100
  cursor?: Cursor
}

Output:

TypeScript
{ sessions: Session[]; nextCursor?: string }

Errors: U.

Named types: Cursor, HolderKind, Session.

sessions.wait

Wait until ready (or terminal) or until timeoutMs. until: 'stream' is done once the session's stream can be opened (streamReadyAt set), at ready or before it, or once it is terminal. A timeout is a normal result, never an error.

RESTGET /v1/sessions/wait (input as query parameters)
RPC/rpc/v2/sessions/wait
MCPtool sessions_wait; hints: read-only, idempotent
Authdevices:read
Tenancyproject
Troupe Cloudanswered by the control plane
Stabilitystable, since 1.0

Input:

TypeScript
{
  sessionId: SessionId
  until?: 'ready' | 'stream' | 'terminal'  // default 'ready'
  timeoutMs?: TimeoutMs  // default 30000
}

Output:

TypeScript
{ done: boolean; session: Session }

Errors: U, NOT_FOUND.

Named types: Session, SessionId, TimeoutMs.

sessions.heartbeat

Extend liveness. Required for test-worker; a keepalive for other holders.

RESTPOST /v1/sessions/heartbeat (input as a JSON body)
RPC/rpc/v2/sessions/heartbeat
MCPtool sessions_heartbeat; hints: idempotent
Authdevices:acquire
Tenancyproject
Troupe Cloudanswered by the control plane
Stabilitystable, since 1.0

Input:

TypeScript
{ sessionId: SessionId }

Output:

TypeScript
{ expiresAt: string; maxEndsAt?: string }

Errors: U, NOT_FOUND, SESSION_ENDED, SESSION_BUSY.

Named types: SessionId.

sessions.release

End a session: canceled before ready, ended(released) after. The device returns warm, or is recycled when healthy is false. Releasing an ended session returns it unchanged.

RESTPOST /v1/sessions/release (input as a JSON body)
RPC/rpc/v2/sessions/release
MCPtool sessions_release; hints: idempotent
Authdevices:acquire
Tenancyproject
Troupe Cloudanswered by the control plane
Stabilitystable, since 1.0

Input:

TypeScript
{
  sessionId: SessionId
  healthy?: boolean  // default true
  reason?: Label
}

Output:

TypeScript
Session

Errors: U, NOT_FOUND, SESSION_BUSY.

Named types: Label, Session, SessionId.

sessions.events

A session's events: status, app state, crashes, input state and stream readiness

RESTGET /v1/sessions/events (input as query parameters)
RPC/rpc/v2/sessions/events
MCPnot a tool (an event iterator; MCP tools return one result); hints: read-only, idempotent
Authdevices:read
Tenancyproject
Troupe Cloudanswered by the control plane
Stabilitystable, since 1.0

Input:

TypeScript
{ sessionId?: SessionId; since?: Seq }

Output: an event iterator (text/event-stream on REST), each event:

TypeScript
SessionEvent

Errors: U, NOT_FOUND.

Named types: Seq, SessionEvent, SessionId.

esc

    Type to search every page, the protocol reference and the cloud API.