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

# Authorize a realtime channel

> Sign a Pusher subscription for `private-thread-{id}`. The token must own the thread. Used by the browser SDK after `realtime/config`.




## OpenAPI

````yaml /openapi.yaml post /v1/loom/realtime/auth
openapi: 3.1.0
info:
  title: Patchwork API
  version: 1.0.0
  description: >
    Public data-plane API. Two products today: Identify (bare account
    resolution) and Loom (threads, runs, and outcomes). Every response is a JSON
    envelope — `status: success` with `data`, or `status: error` with `error`.
  contact:
    url: https://usepatchwork.co
servers:
  - url: https://api.usepatchwork.co
security:
  - bearerAuth: []
tags:
  - name: Identify
    description: Resolve an account or wallet to the institution and rails behind it.
  - name: Loom
    description: Threads, messages, runs, and outcomes for an embedded agent.
paths:
  /v1/loom/realtime/auth:
    post:
      tags:
        - Loom
      summary: Authorize a realtime channel
      description: >
        Sign a Pusher subscription for `private-thread-{id}`. The token must own
        the thread. Used by the browser SDK after `realtime/config`.
      operationId: realtimeAuth
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - channel_name
                - socket_id
              properties:
                channel_name:
                  type: string
                  example: private-thread-3fa85f64-5717-4562-b3fc-2c963f66afa6
                socket_id:
                  type: string
      responses:
        '200':
          description: Channel authorization payload from Pusher.
        '401':
          description: Missing or invalid credentials.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Not allowed on this channel.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    Error:
      type: object
      required:
        - status
        - error
      properties:
        status:
          type: string
          const: error
        error:
          type: object
          required:
            - message
            - code
          properties:
            message:
              type: string
              description: Human-readable explanation.
            code:
              type: string
              description: Stable machine-readable code.
            details:
              description: Optional extra context.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >
        Identify accepts a workspace API key (`sk_…`). Loom accepts either a
        short-lived session token (direct) or a workspace API key (relay).

````