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

# Stream Thread Events

> Open a channel-filtered SSE stream of the thread's run events.

Thread-scoped: events for any run on the thread flow through, so a
client can open the stream then issue ``run.start``. Each SSE frame's
``data:`` is a protocol event envelope; ``id:`` is the ``seq`` a client
echoes back as ``since`` on resume.

DB work runs in short-lived sessions (the upfront ownership check here, and
each run-lister poll) so no connection is held for the SSE lifetime (#423).



## OpenAPI

````yaml /openapi.json post /threads/{thread_id}/stream/events
openapi: 3.1.0
info:
  title: Aegra
  description: Production-ready Agent Protocol server
  version: 0.9.24
servers: []
security: []
tags:
  - name: Assistants
    description: A configured instance of a graph.
  - name: Threads
    description: Accumulated state and outputs from a group of runs.
  - name: Thread Runs
    description: Invoke a graph on a thread, updating its persistent state.
  - name: Stateless Runs
    description: Invoke a graph without state or memory persistence.
  - name: Crons
    description: Scheduled recurring runs on a cron schedule.
  - name: Store
    description: Persistent key-value and semantic storage available from any thread.
  - name: Event Streaming
    description: Agent Protocol v2 thread event streaming and commands.
  - name: Health
    description: Server health checks and service information.
paths:
  /threads/{thread_id}/stream/events:
    post:
      tags:
        - Event Streaming
      summary: Stream Thread Events
      description: >-
        Open a channel-filtered SSE stream of the thread's run events.


        Thread-scoped: events for any run on the thread flow through, so a

        client can open the stream then issue ``run.start``. Each SSE frame's

        ``data:`` is a protocol event envelope; ``id:`` is the ``seq`` a client

        echoes back as ``since`` on resume.


        DB work runs in short-lived sessions (the upfront ownership check here,
        and

        each run-lister poll) so no connection is held for the SSE lifetime
        (#423).
      operationId: stream_thread_events_threads__thread_id__stream_events_post
      parameters:
        - name: thread_id
          in: path
          required: true
          schema:
            type: string
            title: Thread Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EventStreamRequest'
      responses:
        '200':
          description: SSE stream of protocol event envelopes
          content:
            text/event-stream: {}
        '400':
          description: Invalid request (unsupported channels, malformed command)
        '404':
          description: Thread owned by another user
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
        '503':
          description: v2 disabled by flag, or runtime too old for native v3 events
components:
  schemas:
    EventStreamRequest:
      properties:
        channels:
          items:
            type: string
          type: array
          title: Channels
          description: Channels to subscribe to (e.g. messages, values, lifecycle).
        namespaces:
          anyOf:
            - items:
                items:
                  type: string
                type: array
              type: array
            - type: 'null'
          title: Namespaces
          description: Subgraph namespace prefixes to include.
        depth:
          anyOf:
            - type: integer
              minimum: 0
            - type: 'null'
          title: Depth
          description: Max subgraph nesting depth to include.
        since:
          anyOf:
            - type: integer
              minimum: 0
            - type: 'null'
          title: Since
          description: >-
            Last seq the client saw; events at or below it are skipped on
            resume.
      type: object
      required:
        - channels
      title: EventStreamRequest
      description: |-
        Body for ``POST /threads/{thread_id}/stream/events``.

        Thread-scoped, matching the LangGraph SDK: no run id — the stream
        carries events for whatever run(s) execute on the thread.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError

````