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

# Stream a turn

> A v3 turn's frames after the cursor, then its live tail, server to server. Requires conversations:use and the conversation's end user. The server ends the response with : end once the turn is at rest and every kept call has its final outcome, or 60 s after rest; resubscribe with after= the last id for more. A turn whose stream is gone answers 410 stream_expired: read the conversation, which is durable. Any turn that is not this conversation's v3 turn answers 404 turn_not_found. An organization key is refused with 403 legacy_key_person_route.



## OpenAPI

````yaml /openapi.generated.json get /conversations/instances/{instanceSlug}/conversations/{conversationID}/turns/{turnID}/stream
openapi: 3.1.0
info:
  description: >-
    Public API reference. Generated from apps/engine/openapi.yaml by make
    docs-openapi-write. Do not edit.
  title: Nexio platform API
  version: '1'
servers:
  - url: https://api.usenexio.com
security: []
tags:
  - name: Access
  - name: Catalog
  - name: Conversations
  - name: Documents
  - name: Engines
  - name: Events
  - name: Feedback
  - name: Graph
  - name: Records
  - name: Roadmap
  - name: Runs
  - name: Webhooks
  - name: accounts
  - name: actions
  - name: activities
  - name: activity-feed
  - name: attachments
  - name: audit
  - name: benefit-plans
  - name: billing-transactions
  - name: carrier_documents
  - name: certificate-holders
  - name: certificate_drafts
  - name: certificates
  - name: change_feed
  - name: claims
  - name: classes
  - name: codes
  - name: commission_facts
  - name: connections
  - name: contacts
  - name: contingencies
  - name: conversations
  - name: customer
  - name: customer_contacts
  - name: deals
  - name: dependents
  - name: document_extractions
  - name: documents
  - name: drivers
  - name: eforms
  - name: employees
  - name: events
  - name: feature_requests
  - name: form-templates
  - name: invoices
  - name: leads
  - name: line_schedules_other
  - name: loss_history
  - name: machines
  - name: markets
  - name: motor-carriers
  - name: notes
  - name: opportunities
  - name: opportunity-signals
  - name: pages
  - name: personal_lines_detail
  - name: placement_choices
  - name: placement_feedback
  - name: placements
  - name: policies
  - name: policy_parties
  - name: policy_personnel
  - name: policy_transactions
  - name: premium_rows
  - name: procedures
  - name: proposals
  - name: quote_comparisons
  - name: quotes
  - name: records
  - name: register-views
  - name: renewal-entries
  - name: risk_review_choices
  - name: rollups
  - name: seats
  - name: sec-filings
  - name: service_agreements
  - name: submissions
  - name: suspenses
  - name: tasks
  - name: umbrella_underlying
  - name: underwriting_questions
  - name: uploaded_documents
  - name: vehicles
  - name: workflows
paths:
  /conversations/instances/{instanceSlug}/conversations/{conversationID}/turns/{turnID}/stream:
    get:
      tags:
        - Conversations
      summary: Stream a turn
      description: >-
        A v3 turn's frames after the cursor, then its live tail, server to
        server. Requires conversations:use and the conversation's end user. The
        server ends the response with : end once the turn is at rest and every
        kept call has its final outcome, or 60 s after rest; resubscribe with
        after= the last id for more. A turn whose stream is gone answers 410
        stream_expired: read the conversation, which is durable. Any turn that
        is not this conversation's v3 turn answers 404 turn_not_found. An
        organization key is refused with 403 legacy_key_person_route.
      operationId: streamTurn
      parameters:
        - description: The conversation instance's slug.
          in: path
          name: instanceSlug
          required: true
          schema:
            description: The conversation instance's slug.
            type: string
        - description: The conversation's id (a UUID).
          in: path
          name: conversationID
          required: true
          schema:
            description: The conversation's id (a UUID).
            type: string
        - description: The turn's id (a UUID).
          in: path
          name: turnID
          required: true
          schema:
            description: The turn's id (a UUID).
            type: string
        - description: Required. The end user the conversation belongs to.
          explode: false
          in: query
          name: end_user
          schema:
            description: Required. The end user the conversation belongs to.
            type: string
        - description: >-
            An executor id: the subscription is also the turn's executor claim.
            The first line answers : executor &lt;epoch&gt;, : executor held or
            : executor sealed; held and sealed still stream.
          explode: false
          in: query
          name: executor
          schema:
            description: >-
              An executor id: the subscription is also the turn's executor
              claim. The first line answers : executor &lt;epoch&gt;, : executor
              held or : executor sealed; held and sealed still stream.
            type: string
        - description: >-
            With executor, the executor's own end, as RFC 3339 or unix
            milliseconds.
          in: header
          name: Nexio-Executor-Until
          schema:
            description: >-
              With executor, the executor's own end, as RFC 3339 or unix
              milliseconds.
            type: string
        - description: >-
            Resume after this frame id, a non-negative integer. When absent,
            Last-Event-ID is used; when both are absent the stream starts at the
            first frame.
          explode: false
          in: query
          name: after
          schema:
            description: >-
              Resume after this frame id, a non-negative integer. When absent,
              Last-Event-ID is used; when both are absent the stream starts at
              the first frame.
            type: string
        - description: >-
            The id of the last frame the reader applied, as the SSE reconnect
            sends it. Read only when after is absent.
          in: header
          name: Last-Event-ID
          schema:
            description: >-
              The id of the last frame the reader applied, as the SSE reconnect
              sends it. Read only when after is absent.
            type: string
      responses:
        '200':
          content:
            text/event-stream:
              schema:
                $ref: '#/components/schemas/TurnFrame'
          description: >-
            An event stream. Each message carries id (the resume cursor), event
            (the frame type) and data (one TurnFrame as JSON). `: ka` comments
            keep an idle stream open; a final `: end` comment closes the
            server's window, after which the reader resubscribes with after= its
            last id if it needs more.
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
          description: Bad Request
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
          description: Unauthorized
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
          description: Forbidden
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
          description: Not Found
        '410':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
          description: Gone
        '429':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
          description: Too Many Requests
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
          description: Internal Server Error
        '503':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
          description: Service Unavailable
      security:
        - bearer: []
components:
  schemas:
    TurnFrame:
      description: One frame of the stream, discriminated by type.
      discriminator:
        mapping:
          attachment: '#/components/schemas/TurnFrameAttachment'
          component: '#/components/schemas/TurnFrameComponent'
          conversation: '#/components/schemas/TurnFrameConversation'
          error: '#/components/schemas/TurnFrameError'
          guardrail: '#/components/schemas/TurnFrameGuardrail'
          outcome: '#/components/schemas/TurnFrameOutcome'
          pending_confirmation: '#/components/schemas/TurnFramePendingConfirmation'
          seal: '#/components/schemas/TurnFrameSeal'
          text_delta: '#/components/schemas/TurnFrameTextDelta'
          tool_activity: '#/components/schemas/TurnFrameToolActivity'
          tool_use: '#/components/schemas/TurnFrameToolUse'
          turn_end: '#/components/schemas/TurnFrameTurnEnd'
          turn_paused: '#/components/schemas/TurnFrameTurnPaused'
          verification: '#/components/schemas/TurnFrameVerification'
        propertyName: type
      oneOf:
        - $ref: '#/components/schemas/TurnFrameAttachment'
        - $ref: '#/components/schemas/TurnFrameComponent'
        - $ref: '#/components/schemas/TurnFrameConversation'
        - $ref: '#/components/schemas/TurnFrameError'
        - $ref: '#/components/schemas/TurnFrameGuardrail'
        - $ref: '#/components/schemas/TurnFrameOutcome'
        - $ref: '#/components/schemas/TurnFramePendingConfirmation'
        - $ref: '#/components/schemas/TurnFrameSeal'
        - $ref: '#/components/schemas/TurnFrameTextDelta'
        - $ref: '#/components/schemas/TurnFrameToolActivity'
        - $ref: '#/components/schemas/TurnFrameToolUse'
        - $ref: '#/components/schemas/TurnFrameTurnEnd'
        - $ref: '#/components/schemas/TurnFrameTurnPaused'
        - $ref: '#/components/schemas/TurnFrameVerification'
    ErrorEnvelope:
      additionalProperties: false
      properties:
        code:
          description: The stable machine-readable error code. One meaning forever.
          type: string
        details:
          description: Structured detail for the code.
        message:
          description: A human-readable sentence about this occurrence.
          type: string
      required:
        - code
        - message
      type: object
    TurnFrameAttachment:
      additionalProperties: false
      properties:
        attachments:
          items:
            $ref: '#/components/schemas/TurnAttachment'
          type:
            - array
            - 'null'
        message_id:
          type: string
        seq:
          description: >-
            The frame's sequence number in the turn, from 1, strictly
            increasing; also the id line. A replay after a seal may skip
            withdrawn numbers.
          format: int64
          type: integer
        turn_id:
          description: The turn's id.
          type: string
        type:
          description: The frame type; also the event line.
          enum:
            - attachment
          type: string
      required:
        - message_id
        - attachments
        - type
        - turn_id
        - seq
      type: object
    TurnFrameComponent:
      additionalProperties: false
      properties:
        bytes:
          format: int64
          type: integer
        component:
          type: string
        props:
          description: The card's props; absent when ref is true.
        ref:
          description: >-
            True for a card over the frame limit: read it from the turn's
            components route.
          type: boolean
        seq:
          description: >-
            The frame's sequence number in the turn, from 1, strictly
            increasing; also the id line. A replay after a seal may skip
            withdrawn numbers.
          format: int64
          type: integer
        tool_call_id:
          type: string
        turn_id:
          description: The turn's id.
          type: string
        type:
          description: The frame type; also the event line.
          enum:
            - component
          type: string
        version:
          format: int64
          type: integer
      required:
        - component
        - version
        - type
        - turn_id
        - seq
      type: object
    TurnFrameConversation:
      additionalProperties: false
      properties:
        conversation_id:
          type: string
        runtime:
          type: string
        seq:
          description: >-
            The frame's sequence number in the turn, from 1, strictly
            increasing; also the id line. A replay after a seal may skip
            withdrawn numbers.
          format: int64
          type: integer
        turn_control:
          type: boolean
        turn_id:
          description: The turn's id.
          type: string
        turn_stream:
          type: boolean
        type:
          description: The frame type; also the event line.
          enum:
            - conversation
          type: string
        user_message_id:
          description: The user message this turn stored; absent on a resume.
          type: string
      required:
        - conversation_id
        - turn_control
        - turn_stream
        - runtime
        - type
        - turn_id
        - seq
      type: object
    TurnFrameError:
      additionalProperties: false
      properties:
        code:
          type: string
        message:
          type: string
        reason:
          type: string
        seq:
          description: >-
            The frame's sequence number in the turn, from 1, strictly
            increasing; also the id line. A replay after a seal may skip
            withdrawn numbers.
          format: int64
          type: integer
        turn_id:
          description: The turn's id.
          type: string
        type:
          description: The frame type; also the event line.
          enum:
            - error
          type: string
      required:
        - code
        - message
        - type
        - turn_id
        - seq
      type: object
    TurnFrameGuardrail:
      additionalProperties: false
      properties:
        decision:
          type: string
        rule_id:
          type: string
        seq:
          description: >-
            The frame's sequence number in the turn, from 1, strictly
            increasing; also the id line. A replay after a seal may skip
            withdrawn numbers.
          format: int64
          type: integer
        turn_id:
          description: The turn's id.
          type: string
        type:
          description: The frame type; also the event line.
          enum:
            - guardrail
          type: string
      required:
        - rule_id
        - decision
        - type
        - turn_id
        - seq
      type: object
    TurnFrameOutcome:
      additionalProperties: false
      properties:
        display:
          $ref: '#/components/schemas/TurnDisplay'
        replaces:
          enum:
            - placeholder
            - none
          type: string
        result:
          enum:
            - succeeded
            - failed
            - may_have_run
            - did_not_run
          type: string
        seq:
          description: >-
            The frame's sequence number in the turn, from 1, strictly
            increasing; also the id line. A replay after a seal may skip
            withdrawn numbers.
          format: int64
          type: integer
        stage:
          enum:
            - provisional
            - final
          type: string
        tool_call_id:
          type: string
        turn_id:
          description: The turn's id.
          type: string
        type:
          description: The frame type; also the event line.
          enum:
            - outcome
          type: string
      required:
        - tool_call_id
        - result
        - stage
        - replaces
        - type
        - turn_id
        - seq
      type: object
    TurnFramePendingConfirmation:
      additionalProperties: false
      properties:
        execution:
          type: string
        input: {}
        name:
          type: string
        reason:
          type: string
        seq:
          description: >-
            The frame's sequence number in the turn, from 1, strictly
            increasing; also the id line. A replay after a seal may skip
            withdrawn numbers.
          format: int64
          type: integer
        tool_call_id:
          type: string
        turn_id:
          description: The turn's id.
          type: string
        type:
          description: The frame type; also the event line.
          enum:
            - pending_confirmation
          type: string
      required:
        - tool_call_id
        - name
        - input
        - reason
        - type
        - turn_id
        - seq
      type: object
    TurnFrameSeal:
      additionalProperties: false
      properties:
        sealed_by:
          enum:
            - user
            - edit
          type: string
        sealed_through:
          format: int64
          type: integer
        seq:
          description: >-
            The frame's sequence number in the turn, from 1, strictly
            increasing; also the id line. A replay after a seal may skip
            withdrawn numbers.
          format: int64
          type: integer
        turn_id:
          description: The turn's id.
          type: string
        type:
          description: The frame type; also the event line.
          enum:
            - seal
          type: string
      required:
        - sealed_through
        - sealed_by
        - type
        - turn_id
        - seq
      type: object
    TurnFrameTextDelta:
      additionalProperties: false
      properties:
        round:
          description: The model round within the turn.
          format: int64
          type: integer
        seq:
          description: >-
            The frame's sequence number in the turn, from 1, strictly
            increasing; also the id line. A replay after a seal may skip
            withdrawn numbers.
          format: int64
          type: integer
        text:
          type: string
        turn_id:
          description: The turn's id.
          type: string
        type:
          description: The frame type; also the event line.
          enum:
            - text_delta
          type: string
      required:
        - text
        - round
        - type
        - turn_id
        - seq
      type: object
    TurnFrameToolActivity:
      additionalProperties: false
      properties:
        display:
          $ref: '#/components/schemas/TurnDisplay'
        effect:
          description: >-
            read, write, outbound, destructive or browser; empty for a tool that
            declares none.
          type: string
        execution:
          enum:
            - platform
            - client
          type: string
        name:
          type: string
        phase:
          enum:
            - started
            - completed
            - failed
            - stopped
            - not_run
          type: string
        seq:
          description: >-
            The frame's sequence number in the turn, from 1, strictly
            increasing; also the id line. A replay after a seal may skip
            withdrawn numbers.
          format: int64
          type: integer
        sites:
          description: The hosts a completed web_research step read.
          items:
            type: string
          type:
            - array
            - 'null'
        tool_call_id:
          type: string
        turn_id:
          description: The turn's id.
          type: string
        type:
          description: The frame type; also the event line.
          enum:
            - tool_activity
          type: string
      required:
        - tool_call_id
        - name
        - execution
        - phase
        - effect
        - type
        - turn_id
        - seq
      type: object
    TurnFrameToolUse:
      additionalProperties: false
      properties:
        effect:
          type: string
        executor_epoch:
          description: The executor epoch live when the frame was appended; 0 if none.
          format: int64
          type: integer
        kind:
          type: string
        name:
          type: string
        seq:
          description: >-
            The frame's sequence number in the turn, from 1, strictly
            increasing; also the id line. A replay after a seal may skip
            withdrawn numbers.
          format: int64
          type: integer
        tool_call_id:
          type: string
        turn_id:
          description: The turn's id.
          type: string
        type:
          description: The frame type; also the event line.
          enum:
            - tool_use
          type: string
      required:
        - tool_call_id
        - name
        - effect
        - executor_epoch
        - kind
        - type
        - turn_id
        - seq
      type: object
    TurnFrameTurnEnd:
      additionalProperties: false
      properties:
        seq:
          description: >-
            The frame's sequence number in the turn, from 1, strictly
            increasing; also the id line. A replay after a seal may skip
            withdrawn numbers.
          format: int64
          type: integer
        status:
          enum:
            - completed
            - stopped
            - failed
          type: string
        stop_reason:
          type: string
        turn_id:
          description: The turn's id.
          type: string
        type:
          description: The frame type; also the event line.
          enum:
            - turn_end
          type: string
        usage:
          $ref: '#/components/schemas/TurnUsage'
      required:
        - stop_reason
        - status
        - usage
        - type
        - turn_id
        - seq
      type: object
    TurnFrameTurnPaused:
      additionalProperties: false
      properties:
        reason:
          type: string
        seq:
          description: >-
            The frame's sequence number in the turn, from 1, strictly
            increasing; also the id line. A replay after a seal may skip
            withdrawn numbers.
          format: int64
          type: integer
        tool_call_ids:
          items:
            type: string
          type:
            - array
            - 'null'
        turn_id:
          description: The turn's id.
          type: string
        type:
          description: The frame type; also the event line.
          enum:
            - turn_paused
          type: string
      required:
        - reason
        - tool_call_ids
        - type
        - turn_id
        - seq
      type: object
    TurnFrameVerification:
      additionalProperties: false
      properties:
        citations:
          description: 'One verdict per doc: address the answer cites.'
          items:
            $ref: '#/components/schemas/TurnVerificationCitation'
          type:
            - array
            - 'null'
        message_id:
          description: The answer message the check read.
          type: string
        seq:
          description: >-
            The frame's sequence number in the turn, from 1, strictly
            increasing; also the id line. A replay after a seal may skip
            withdrawn numbers.
          format: int64
          type: integer
        turn_id:
          description: The turn's id.
          type: string
        type:
          description: The frame type; also the event line.
          enum:
            - verification
          type: string
      required:
        - message_id
        - citations
        - type
        - turn_id
        - seq
      type: object
    TurnAttachment:
      additionalProperties: false
      properties:
        id:
          type: string
        media_type:
          type: string
        name:
          type: string
        notice:
          type: string
      required:
        - id
        - name
        - media_type
      type: object
    TurnDisplay:
      additionalProperties: false
      properties:
        flags:
          $ref: '#/components/schemas/TurnDisplayFlags'
        navigation:
          $ref: '#/components/schemas/TurnDisplayNavigation'
        refusal:
          $ref: '#/components/schemas/TurnDisplayRefusal'
        subject:
          $ref: '#/components/schemas/TurnDisplaySubject'
        summary:
          type: string
      type: object
    TurnUsage:
      additionalProperties: false
      properties:
        cache_creation_input_tokens:
          format: int64
          type: integer
        cache_read_input_tokens:
          format: int64
          type: integer
        cached_input_tokens:
          format: int64
          type: integer
        input_tokens:
          format: int64
          type: integer
        output_tokens:
          format: int64
          type: integer
        total_tokens:
          format: int64
          type: integer
      required:
        - input_tokens
        - output_tokens
        - total_tokens
        - cached_input_tokens
        - cache_creation_input_tokens
        - cache_read_input_tokens
      type: object
    TurnVerificationCitation:
      additionalProperties: false
      properties:
        anchor:
          type: string
        check:
          type: string
        document_id:
          type: string
        filename:
          type: string
        page:
          format: int64
          type: integer
        result:
          type: string
        version:
          format: int64
          type: integer
      required:
        - document_id
        - version
        - result
      type: object
    TurnDisplayFlags:
      additionalProperties: false
      properties:
        cached:
          type: boolean
        designed_from_record:
          type: boolean
        following:
          type: boolean
        not_covered:
          type: boolean
        not_started:
          type: boolean
        reused:
          type: boolean
        timed_out:
          type: boolean
      type: object
    TurnDisplayNavigation:
      additionalProperties: false
      properties:
        navigated_to:
          type: string
        opened:
          type: string
      required:
        - navigated_to
        - opened
      type: object
    TurnDisplayRefusal:
      additionalProperties: false
      properties:
        code:
          type: string
        message:
          type: string
      required:
        - code
        - message
      type: object
    TurnDisplaySubject:
      additionalProperties: false
      properties:
        account:
          description: >-
            The name of the account the call ran on; absent when the turn does
            not know it.
          type: string
        count:
          description: Rows or items the call answered; absent when not meaningful.
          format: int64
          type: integer
        failure:
          description: Why the call did not do what it asked; absent on a call that did.
          enum:
            - timed_out
            - refused
            - not_found
            - unavailable
          type: string
        object:
          description: >-
            What the call acted on: a record type's label, a file name, a form
            name, a search term or a class name.
          type: string
      type: object
  securitySchemes:
    bearer:
      description: The org's platform API key.
      scheme: bearer
      type: http

````

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