> ## Documentation Index
> Fetch the complete documentation index at: https://docs.tembo.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Live resource subscriptions

> Native WebSocket. Send `{ op: "subscribe", id, resource, input }` or `{ op: "unsubscribe", id }`; receive `{ id, type: "ready" | "event" | "error" }`.



## OpenAPI

````yaml https://api.tembo.io/public-api/openapi/public get /v1/live
openapi: 3.1.0
info:
  title: Tembo Public API
  description: >-
    Manage agents, sessions, repositories, and organization resources with the
    Tembo API.
  version: 1.0.0
servers:
  - url: https://api.tembo.io
    description: Tembo API
  - url: https://{deployment-origin}/api/public-api
    description: Self-hosted Tembo
    variables:
      deployment-origin:
        default: tembo.example.com
        description: Hostname of your self-hosted Tembo deployment
security: []
paths:
  /v1/live:
    get:
      tags:
        - Live
      summary: Live resource subscriptions
      description: >-
        Native WebSocket. Send `{ op: "subscribe", id, resource, input }` or `{
        op: "unsubscribe", id }`; receive `{ id, type: "ready" | "event" |
        "error" }`.
      operationId: liveConnection
      parameters:
        - in: query
          name: ticket
          schema:
            type: string
            minLength: 1
          required: true
      responses:
        '101':
          description: Authorized native WebSocket
        '401':
          description: Invalid or expired live ticket
      x-codeSamples:
        - lang: typescript
          label: TypeScript SDK
          source: |
            import Tembo from '@tembo-io/sdk';

            const client = new Tembo();

            const { ticket } = await client.live.authorize();
            const connection = client.live.connect({ ticket });

            try {
              for await (const message of connection) {
                if (message.type === 'ready' && message.id === undefined) {
                  connection.send({
                    op: 'subscribe',
                    id: 'events',
                    resource: 'sessions.events',
                    input: { scope: { sessionId: 'sessionId' } },
                  });
                }
                console.log(message);
              }
            } finally {
              connection.close();
            }

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.