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

# Open the event stream

> WebSocket upgrade; authenticate with a versioned first frame. See backend/docs/realtime.md. No bearer tokens in URLs. This is a WebSocket protocol, not a REST envelope.



## OpenAPI

````yaml /openapi/widget.json get /api/v1/chat/stream
openapi: 3.1.0
info:
  title: Widget API
  version: 1.0.0
  description: >-
    Embed Writine chat on your own site. These endpoints need no Writine
    account: the widget routes are authorised by your site origin allowlist, and
    the visitor routes by a token issued when a conversation starts.
servers:
  - url: https://api.writine.com
    description: Production
security: []
paths:
  /api/v1/chat/stream:
    get:
      summary: Open the event stream
      description: >-
        WebSocket upgrade; authenticate with a versioned first frame. See
        backend/docs/realtime.md. No bearer tokens in URLs. This is a WebSocket
        protocol, not a REST envelope.
      operationId: get_api-v1-chat-stream
      responses:
        '101':
          description: Switching protocols
        '403':
          description: Invalid origin
        '503':
          description: Connection capacity exceeded
      security: []

````

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