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

# Issue a short-lived single-use WebSocket ticket



## OpenAPI

````yaml /public/reference/openapi.json post /v1/realtime/tickets
openapi: 3.1.0
info:
  description: >-
    Public Tayho API for indexed protocol state, live calculations, relayed
    actions, and automatic-order lifecycle.
  title: Tayho API
  version: 1.0.0
servers:
  - description: Development
    url: https://api.testnet.tayho.io
security: []
tags:
  - name: System
  - name: Markets
  - name: Positions
  - name: Traders
  - name: Orders
  - name: Intents
  - name: Actions
  - name: Portfolio
  - name: Vault
  - name: Staking
  - name: Trading
  - name: Realtime
paths:
  /v1/realtime/tickets:
    post:
      tags:
        - Realtime
      summary: Issue a short-lived single-use WebSocket ticket
      operationId: postV1RealtimeTickets
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PostV1RealtimeTicketsResponse'
          description: Successful response.
        '400':
          $ref: '#/components/responses/Error400'
        '401':
          $ref: '#/components/responses/Error401'
        '403':
          $ref: '#/components/responses/Error403'
        '404':
          $ref: '#/components/responses/Error404'
        '413':
          $ref: '#/components/responses/Error413'
        '415':
          $ref: '#/components/responses/Error415'
        '422':
          $ref: '#/components/responses/Error422'
        '429':
          $ref: '#/components/responses/Error429'
        '500':
          $ref: '#/components/responses/Error500'
        '503':
          $ref: '#/components/responses/Error503'
      security:
        - TayhoApiKey: []
components:
  schemas:
    PostV1RealtimeTicketsResponse:
      $ref: '#/components/schemas/RealtimeTicket'
    RealtimeTicket:
      additionalProperties: false
      properties:
        expiresAt:
          format: date-time
          type: string
        ticket:
          maxLength: 128
          minLength: 20
          type: string
      required:
        - ticket
        - expiresAt
      type: object
    TayhoError:
      additionalProperties: true
      properties:
        code:
          type: string
        error:
          type: string
        requestId:
          pattern: ^[A-Za-z0-9._:-]{8,128}$
          type: string
      required:
        - error
      type: object
  responses:
    Error400:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/TayhoError'
      description: Malformed request or unsupported action.
    Error401:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/TayhoError'
      description: Missing or invalid API key.
    Error403:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/TayhoError'
      description: The API key does not grant the required scope.
    Error404:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/TayhoError'
      description: The requested resource does not exist.
    Error413:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/TayhoError'
      description: The request body exceeds the accepted size.
    Error415:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/TayhoError'
      description: Content-Type must be application/json.
    Error422:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/TayhoError'
      description: Request validation failed.
    Error429:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/TayhoError'
      description: The applicable request quota was exceeded.
      headers:
        Retry-After:
          description: Seconds to wait before retrying.
          schema:
            minimum: 1
            type: integer
    Error500:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/TayhoError'
      description: The request failed unexpectedly.
    Error503:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/TayhoError'
      description: A required Tayho dependency is temporarily unavailable.
      headers:
        Retry-After:
          description: Seconds to wait before retrying.
          schema:
            minimum: 1
            type: integer
  securitySchemes:
    TayhoApiKey:
      description: Tayho project API key with the scope declared by the operation.
      in: header
      name: X-API-Key
      type: apiKey

````