---
title: "Create a live stream ticket"
method: POST
path: "/v1/sessions/{id}/streams"
---

# Create a live stream ticket

`POST /v1/sessions/{id}/streams`

## Request

- Base URL: `https://assemble-vms-api.fly.dev`
- URL: `https://assemble-vms-api.fly.dev/v1/sessions/{id}/streams`
- Auth: HTTP bearer

Mint a single-use WebSocket ticket for a live desktop view (VNC-compatible binary stream) or an interactive terminal (JSON text frames). Connect to the returned url with exactly the returned subprotocols before expiresAt. The credential travels only in the subprotocol. Streams end when the session pauses, stops, or is deleted.

## Request body

- CreateStream
  - `type` 'desktop' | 'terminal', required
  - `cols` integer: Terminal streams only. Defaults to 120.
  - `rows` integer: Terminal streams only. Defaults to 30.

## Response `201`

Single-use connection grant; the subprotocols contain a credential.

- StreamAccess
  - `id` string, required: Ticket ID; each ticket admits one connection.
  - `type` 'desktop' | 'terminal', required
  - `url` string, required: WebSocket endpoint to connect to.
  - `subprotocols` string[], required: Pass exactly these WebSocket subprotocols; the second carries the single-use credential.
  - `expiresAt` string, date-time, required: Connect-by deadline for the ticket, not a stream duration.

## Other responses

- `default`: Structured API error. HTTP 400 invalid request, 401 authentication, 404 missing resource, 409 conflict, 413 size limit, 429 quota, or 503 unavailable.

---

[API](https://skmtc.dev/assemble/apis/assemble-vms-api.md) - [All operations](https://skmtc.dev/assemble/apis/assemble-vms-api/llms.txt) - [OpenAPI document](https://skmtc.dev/assemble/apis/assemble-vms-api/revisions/93f55a2e3de3?raw)
