> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.flockx.io/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.flockx.io/_mcp/server.

# websocketChat

GET /v2/websockets/{channel_id}?ticket={ticket}

Reference: https://docs.flockx.io/api-reference/websocket-chat/websocket-chat

## AsyncAPI Specification

```yaml
asyncapi: 2.6.0
info:
  title: websocketChat
  version: subpackage_websocketChat.websocketChat
channels:
  /v2/websockets/{channel_id}?ticket={ticket}:
    bindings:
      ws:
        query:
          type: object
          properties:
            channel_id:
              type: string
            ticket:
              type: string
    publish:
      operationId: subpackage_websocketChat.websocketChat-publish
      summary: receiveMessage
      description: >-
        Event representing a message in the chat, either from a human or an AI
        agent.
      message:
        name: receiveMessage
        title: receiveMessage
        description: >-
          Event representing a message in the chat, either from a human or an AI
          agent.
        payload:
          $ref: '#/components/schemas/websocketChat_event'
    subscribe:
      operationId: subpackage_websocketChat.websocketChat-subscribe
      summary: sendMessage
      description: >-
        Event representing a message in the chat, either from a human or an AI
        agent.
      message:
        name: sendMessage
        title: sendMessage
        description: >-
          Event representing a message in the chat, either from a human or an AI
          agent.
        payload:
          $ref: '#/components/schemas/websocketChat_event'
servers:
  API:
    url: wss://api.flockx.io/api
    protocol: wss
    x-default: true
components:
  schemas:
    ChannelsWebsocketChatMessagesEventSource:
      type: string
      enum:
        - streamchat
        - websocket
        - telegram
        - discord
        - platform
      description: The source of the event
      title: ChannelsWebsocketChatMessagesEventSource
    ChannelsWebsocketChatMessagesEventType:
      type: string
      enum:
        - message
        - control
        - heartbeat
      description: The type of event
      title: ChannelsWebsocketChatMessagesEventType
    ChannelsWebsocketChatMessagesEventRoleType:
      type: string
      enum:
        - human
        - ai
        - system
        - tool
      description: The role type of the event
      title: ChannelsWebsocketChatMessagesEventRoleType
    ChannelsWebsocketChatMessagesEventMedia:
      type: object
      properties:
        media_url:
          type: string
          description: Media URL
        media_id:
          type: string
          description: Media ID
        mime_type:
          type: string
          description: Media MIME type
        width:
          type: number
          format: double
          description: Media width
        height:
          type: number
          format: double
          description: Media height
        source_url:
          type: string
          description: Source URL
        description:
          type: string
          description: Media description
      required:
        - media_url
        - media_id
        - mime_type
        - width
        - height
      description: Media object
      title: ChannelsWebsocketChatMessagesEventMedia
    ChannelsWebsocketChatMessagesEventMetadata:
      type: object
      properties:
        additionalProperties:
          type: string
          description: Additional metadata
      required:
        - additionalProperties
      description: Metadata
      title: ChannelsWebsocketChatMessagesEventMetadata
    websocketChat_event:
      type: object
      properties:
        id:
          type: string
          description: Unique ID for the event
        source:
          $ref: '#/components/schemas/ChannelsWebsocketChatMessagesEventSource'
          description: The source of the event
        type:
          $ref: '#/components/schemas/ChannelsWebsocketChatMessagesEventType'
          description: The type of event
        role_type:
          $ref: '#/components/schemas/ChannelsWebsocketChatMessagesEventRoleType'
          description: The role type of the event
        text:
          type: string
          description: Message text
        media:
          $ref: '#/components/schemas/ChannelsWebsocketChatMessagesEventMedia'
          description: Media object
        twin_id:
          type: string
          description: The AI agent ID
        session_id:
          type: string
          description: The session ID
        created_at:
          type: string
          description: Event timestamp
        metadata:
          $ref: '#/components/schemas/ChannelsWebsocketChatMessagesEventMetadata'
          description: Metadata
      required:
        - id
        - source
        - type
        - role_type
        - twin_id
        - session_id
        - created_at
        - metadata
      title: websocketChat_event

```