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

> ## Agent Instructions
> Typebar, formerly SuperDocs. Same product, same API, same keys: nothing changes for your integration.
> Typebar, formerly SuperDocs, is not related to SuperDoc (superdoc.dev).

# Wait (one blocking call) for the session's latest chat turn and return its result and a download link.

> The one server-side blocking wait for a turn started by /v1/chat/file (or any chat call) that
outlived its caller's timeout. Waits up to wait_seconds for that turn to settle, then returns its
stored result, plus a freshly minted download link when export_format is set. 202 while it is still
running; call again. You can call this from any client, at any time, to get the job's result.
A /v1/chat/file call that ended before its turn ran answers with `edited: false`: nothing was edited, and
sending the same call again is safe. A failure without that field may have edited the document.



## OpenAPI

````yaml /openapi.json get /v1/sessions/{session_id}/result
openapi: 3.1.0
info:
  title: Universal Document AI API
  description: AI-powered document editing with multi-tenant organization support
  version: 2.0.0
servers:
  - url: https://api.superdocs.app
security: []
paths:
  /v1/sessions/{session_id}/result:
    get:
      tags:
        - v1
        - sessions
      summary: >-
        Wait (one blocking call) for the session's latest chat turn and return
        its result and a download link.
      description: >-
        The one server-side blocking wait for a turn started by /v1/chat/file
        (or any chat call) that

        outlived its caller's timeout. Waits up to wait_seconds for that turn to
        settle, then returns its

        stored result, plus a freshly minted download link when export_format is
        set. 202 while it is still

        running; call again. You can call this from any client, at any time, to
        get the job's result.

        A /v1/chat/file call that ended before its turn ran answers with
        `edited: false`: nothing was edited, and

        sending the same call again is safe. A failure without that field may
        have edited the document.
      operationId: wait_for_session_result
      parameters:
        - name: session_id
          in: path
          required: true
          schema:
            type: string
            title: Session Id
        - name: wait_seconds
          in: query
          required: false
          schema:
            type: integer
            maximum: 110
            minimum: 0
            description: How long to wait for the turn to settle (default 90 s).
            default: 90
            title: Wait Seconds
          description: How long to wait for the turn to settle (default 90 s).
        - name: export_format
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                enum:
                  - docx
                  - pdf
                  - html
                  - markdown
                  - txt
              - type: 'null'
            description: >-
              When set, also return `download` for the document in this format
              (not for a failed or cancelled turn). While changes are held for
              review, it is the document as it was before this turn
              (before_this_turn is true): nothing from this turn is in it yet.
            title: Export Format
          description: >-
            When set, also return `download` for the document in this format
            (not for a failed or cancelled turn). While changes are held for
            review, it is the document as it was before this turn
            (before_this_turn is true): nothing from this turn is in it yet.
        - name: response_mode
          in: query
          required: false
          schema:
            enum:
              - summary
              - compact
              - full
            type: string
            description: >-
              Shape of the returned result: 'summary' (default; its size does
              not grow with the document), 'compact' (adds per-section diffs) or
              'full' (adds the whole document HTML).
            default: summary
            title: Response Mode
          description: >-
            Shape of the returned result: 'summary' (default; its size does not
            grow with the document), 'compact' (adds per-section diffs) or
            'full' (adds the whole document HTML).
        - name: job_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              The job_id a 202 from /v1/chat/file returned: wait for exactly
              that call. Omit it to wait for the session's newest chat turn.
            title: Job Id
          description: >-
            The job_id a 202 from /v1/chat/file returned: wait for exactly that
            call. Omit it to wait for the session's newest chat turn.
        - name: authorization
          in: header
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Authorization
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - HTTPBearer: []
components:
  schemas:
    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
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````

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