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

# Get Chat Session



## OpenAPI

````yaml GET /chat/get-chat-session/{session_id}
openapi: 3.1.0
info:
  title: Onyx API
  description: Onyx API for AI-powered enterprise search and chat
  version: Development
servers:
  - url: https://cloud.onyx.app/api
security: []
paths:
  /chat/get-chat-session/{session_id}:
    get:
      tags:
        - public
      summary: Get Chat Session
      operationId: get_chat_session
      parameters:
        - name: session_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Session Id
        - name: is_shared
          in: query
          required: false
          schema:
            type: boolean
            default: false
            title: Is Shared
        - name: include_deleted
          in: query
          required: false
          schema:
            type: boolean
            default: false
            title: Include Deleted
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ChatSessionDetailResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - BearerAuth: []
components:
  schemas:
    ChatSessionDetailResponse:
      properties:
        chat_session_id:
          type: string
          format: uuid
          title: Chat Session Id
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
        persona_id:
          anyOf:
            - type: integer
            - type: 'null'
          title: Persona Id
        persona_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Persona Name
        personal_icon_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Personal Icon Name
        messages:
          items:
            $ref: '#/components/schemas/ChatMessageDetail'
          type: array
          title: Messages
        time_created:
          type: string
          format: date-time
          title: Time Created
        shared_status:
          $ref: '#/components/schemas/ChatSessionSharedStatus'
        current_alternate_model:
          anyOf:
            - type: string
            - type: 'null'
          title: Current Alternate Model
        current_temperature_override:
          anyOf:
            - type: number
            - type: 'null'
          title: Current Temperature Override
        deleted:
          type: boolean
          title: Deleted
          default: false
        packets:
          items:
            items:
              $ref: '#/components/schemas/Packet'
            type: array
          type: array
          title: Packets
      type: object
      required:
        - chat_session_id
        - description
        - persona_name
        - personal_icon_name
        - messages
        - time_created
        - shared_status
        - current_alternate_model
        - current_temperature_override
        - packets
      title: ChatSessionDetailResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ChatMessageDetail:
      properties:
        chat_session_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Chat Session Id
        message_id:
          type: integer
          title: Message Id
        parent_message:
          anyOf:
            - type: integer
            - type: 'null'
          title: Parent Message
        latest_child_message:
          anyOf:
            - type: integer
            - type: 'null'
          title: Latest Child Message
        message:
          type: string
          title: Message
        reasoning_tokens:
          anyOf:
            - type: string
            - type: 'null'
          title: Reasoning Tokens
        message_type:
          $ref: '#/components/schemas/MessageType'
        context_docs:
          anyOf:
            - items:
                $ref: '#/components/schemas/SavedSearchDoc'
              type: array
            - type: 'null'
          title: Context Docs
        citations:
          anyOf:
            - additionalProperties:
                type: string
              type: object
            - type: 'null'
          title: Citations
        time_sent:
          type: string
          format: date-time
          title: Time Sent
        files:
          items:
            $ref: '#/components/schemas/FileDescriptor'
          type: array
          title: Files
        error:
          anyOf:
            - type: string
            - type: 'null'
          title: Error
        current_feedback:
          anyOf:
            - type: string
            - type: 'null'
          title: Current Feedback
      type: object
      required:
        - message_id
        - message
        - message_type
        - time_sent
        - files
      title: ChatMessageDetail
    ChatSessionSharedStatus:
      type: string
      enum:
        - public
        - private
      title: ChatSessionSharedStatus
    Packet:
      properties:
        placement:
          $ref: '#/components/schemas/Placement'
        obj:
          oneOf:
            - $ref: '#/components/schemas/OverallStop'
            - $ref: '#/components/schemas/SectionEnd'
            - $ref: '#/components/schemas/TopLevelBranching'
            - $ref: '#/components/schemas/AgentResponseStart'
            - $ref: '#/components/schemas/AgentResponseDelta'
            - $ref: '#/components/schemas/SearchToolStart'
            - $ref: '#/components/schemas/SearchToolQueriesDelta'
            - $ref: '#/components/schemas/SearchToolDocumentsDelta'
            - $ref: '#/components/schemas/ImageGenerationToolStart'
            - $ref: '#/components/schemas/ImageGenerationToolHeartbeat'
            - $ref: '#/components/schemas/ImageGenerationFinal'
            - $ref: '#/components/schemas/OpenUrlStart'
            - $ref: '#/components/schemas/OpenUrlUrls'
            - $ref: '#/components/schemas/OpenUrlDocuments'
            - $ref: '#/components/schemas/PythonToolStart'
            - $ref: '#/components/schemas/PythonToolDelta'
            - $ref: '#/components/schemas/CustomToolStart'
            - $ref: '#/components/schemas/CustomToolDelta'
            - $ref: '#/components/schemas/ReasoningStart'
            - $ref: '#/components/schemas/ReasoningDelta'
            - $ref: '#/components/schemas/ReasoningDone'
            - $ref: '#/components/schemas/CitationInfo'
            - $ref: '#/components/schemas/DeepResearchPlanStart'
            - $ref: '#/components/schemas/DeepResearchPlanDelta'
            - $ref: '#/components/schemas/ResearchAgentStart'
            - $ref: '#/components/schemas/IntermediateReportStart'
            - $ref: '#/components/schemas/IntermediateReportDelta'
            - $ref: '#/components/schemas/IntermediateReportCitedDocs'
          title: Obj
          discriminator:
            propertyName: type
            mapping:
              citation_info:
                $ref: '#/components/schemas/CitationInfo'
              custom_tool_delta:
                $ref: '#/components/schemas/CustomToolDelta'
              custom_tool_start:
                $ref: '#/components/schemas/CustomToolStart'
              deep_research_plan_delta:
                $ref: '#/components/schemas/DeepResearchPlanDelta'
              deep_research_plan_start:
                $ref: '#/components/schemas/DeepResearchPlanStart'
              image_generation_final:
                $ref: '#/components/schemas/ImageGenerationFinal'
              image_generation_heartbeat:
                $ref: '#/components/schemas/ImageGenerationToolHeartbeat'
              image_generation_start:
                $ref: '#/components/schemas/ImageGenerationToolStart'
              intermediate_report_cited_docs:
                $ref: '#/components/schemas/IntermediateReportCitedDocs'
              intermediate_report_delta:
                $ref: '#/components/schemas/IntermediateReportDelta'
              intermediate_report_start:
                $ref: '#/components/schemas/IntermediateReportStart'
              message_delta:
                $ref: '#/components/schemas/AgentResponseDelta'
              message_start:
                $ref: '#/components/schemas/AgentResponseStart'
              open_url_documents:
                $ref: '#/components/schemas/OpenUrlDocuments'
              open_url_start:
                $ref: '#/components/schemas/OpenUrlStart'
              open_url_urls:
                $ref: '#/components/schemas/OpenUrlUrls'
              python_tool_delta:
                $ref: '#/components/schemas/PythonToolDelta'
              python_tool_start:
                $ref: '#/components/schemas/PythonToolStart'
              reasoning_delta:
                $ref: '#/components/schemas/ReasoningDelta'
              reasoning_done:
                $ref: '#/components/schemas/ReasoningDone'
              reasoning_start:
                $ref: '#/components/schemas/ReasoningStart'
              research_agent_start:
                $ref: '#/components/schemas/ResearchAgentStart'
              search_tool_documents_delta:
                $ref: '#/components/schemas/SearchToolDocumentsDelta'
              search_tool_queries_delta:
                $ref: '#/components/schemas/SearchToolQueriesDelta'
              search_tool_start:
                $ref: '#/components/schemas/SearchToolStart'
              section_end:
                $ref: '#/components/schemas/SectionEnd'
              stop:
                $ref: '#/components/schemas/OverallStop'
              top_level_branching:
                $ref: '#/components/schemas/TopLevelBranching'
      type: object
      required:
        - placement
        - obj
      title: Packet
    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
    MessageType:
      type: string
      enum:
        - system
        - user
        - assistant
        - tool_call
        - tool_call_response
      title: MessageType
    SavedSearchDoc:
      properties:
        document_id:
          type: string
          title: Document Id
        chunk_ind:
          type: integer
          title: Chunk Ind
        semantic_identifier:
          type: string
          title: Semantic Identifier
        link:
          anyOf:
            - type: string
            - type: 'null'
          title: Link
        blurb:
          type: string
          title: Blurb
        source_type:
          $ref: '#/components/schemas/DocumentSource'
        boost:
          type: integer
          title: Boost
        hidden:
          type: boolean
          title: Hidden
        metadata:
          additionalProperties:
            anyOf:
              - type: string
              - items:
                  type: string
                type: array
          type: object
          title: Metadata
        score:
          anyOf:
            - type: number
            - type: 'null'
          title: Score
          default: 0
        is_relevant:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Is Relevant
        relevance_explanation:
          anyOf:
            - type: string
            - type: 'null'
          title: Relevance Explanation
        match_highlights:
          items:
            type: string
          type: array
          title: Match Highlights
        updated_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Updated At
        primary_owners:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Primary Owners
        secondary_owners:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Secondary Owners
        is_internet:
          type: boolean
          title: Is Internet
          default: false
        db_doc_id:
          type: integer
          title: Db Doc Id
      type: object
      required:
        - document_id
        - chunk_ind
        - semantic_identifier
        - blurb
        - source_type
        - boost
        - hidden
        - metadata
        - match_highlights
        - db_doc_id
      title: SavedSearchDoc
    FileDescriptor:
      properties:
        id:
          type: string
          title: Id
        type:
          $ref: '#/components/schemas/ChatFileType'
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
        user_file_id:
          anyOf:
            - type: string
            - type: 'null'
          title: User File Id
      type: object
      required:
        - id
        - type
      title: FileDescriptor
      description: >-
        NOTE: is a `TypedDict` so it can be used as a type hint for a JSONB
        column

        in Postgres
    Placement:
      properties:
        turn_index:
          type: integer
          title: Turn Index
        tab_index:
          type: integer
          title: Tab Index
          default: 0
        sub_turn_index:
          anyOf:
            - type: integer
            - type: 'null'
          title: Sub Turn Index
      type: object
      required:
        - turn_index
      title: Placement
    OverallStop:
      properties:
        type:
          type: string
          const: stop
          title: Type
          default: stop
        stop_reason:
          anyOf:
            - type: string
            - type: 'null'
          title: Stop Reason
      type: object
      title: OverallStop
    SectionEnd:
      properties:
        type:
          type: string
          const: section_end
          title: Type
          default: section_end
      type: object
      title: SectionEnd
    TopLevelBranching:
      properties:
        type:
          type: string
          const: top_level_branching
          title: Type
          default: top_level_branching
        num_parallel_branches:
          type: integer
          title: Num Parallel Branches
      type: object
      required:
        - num_parallel_branches
      title: TopLevelBranching
    AgentResponseStart:
      properties:
        type:
          type: string
          const: message_start
          title: Type
          default: message_start
        final_documents:
          anyOf:
            - items:
                $ref: '#/components/schemas/SearchDoc'
              type: array
            - type: 'null'
          title: Final Documents
      type: object
      title: AgentResponseStart
    AgentResponseDelta:
      properties:
        type:
          type: string
          const: message_delta
          title: Type
          default: message_delta
        content:
          type: string
          title: Content
      type: object
      required:
        - content
      title: AgentResponseDelta
    SearchToolStart:
      properties:
        type:
          type: string
          const: search_tool_start
          title: Type
          default: search_tool_start
        is_internet_search:
          type: boolean
          title: Is Internet Search
          default: false
      type: object
      title: SearchToolStart
    SearchToolQueriesDelta:
      properties:
        type:
          type: string
          const: search_tool_queries_delta
          title: Type
          default: search_tool_queries_delta
        queries:
          items:
            type: string
          type: array
          title: Queries
      type: object
      required:
        - queries
      title: SearchToolQueriesDelta
    SearchToolDocumentsDelta:
      properties:
        type:
          type: string
          const: search_tool_documents_delta
          title: Type
          default: search_tool_documents_delta
        documents:
          items:
            $ref: '#/components/schemas/SearchDoc'
          type: array
          title: Documents
      type: object
      required:
        - documents
      title: SearchToolDocumentsDelta
    ImageGenerationToolStart:
      properties:
        type:
          type: string
          const: image_generation_start
          title: Type
          default: image_generation_start
      type: object
      title: ImageGenerationToolStart
    ImageGenerationToolHeartbeat:
      properties:
        type:
          type: string
          const: image_generation_heartbeat
          title: Type
          default: image_generation_heartbeat
      type: object
      title: ImageGenerationToolHeartbeat
    ImageGenerationFinal:
      properties:
        type:
          type: string
          const: image_generation_final
          title: Type
          default: image_generation_final
        images:
          items:
            $ref: '#/components/schemas/GeneratedImage'
          type: array
          title: Images
      type: object
      required:
        - images
      title: ImageGenerationFinal
    OpenUrlStart:
      properties:
        type:
          type: string
          const: open_url_start
          title: Type
          default: open_url_start
      type: object
      title: OpenUrlStart
      description: Signal that OpenURL tool has started.
    OpenUrlUrls:
      properties:
        type:
          type: string
          const: open_url_urls
          title: Type
          default: open_url_urls
        urls:
          items:
            type: string
          type: array
          title: Urls
      type: object
      required:
        - urls
      title: OpenUrlUrls
      description: URLs to be fetched (sent before crawling begins).
    OpenUrlDocuments:
      properties:
        type:
          type: string
          const: open_url_documents
          title: Type
          default: open_url_documents
        documents:
          items:
            $ref: '#/components/schemas/SearchDoc'
          type: array
          title: Documents
      type: object
      required:
        - documents
      title: OpenUrlDocuments
      description: Final documents after crawling completes.
    PythonToolStart:
      properties:
        type:
          type: string
          const: python_tool_start
          title: Type
          default: python_tool_start
        code:
          type: string
          title: Code
      type: object
      required:
        - code
      title: PythonToolStart
    PythonToolDelta:
      properties:
        type:
          type: string
          const: python_tool_delta
          title: Type
          default: python_tool_delta
        stdout:
          type: string
          title: Stdout
          default: ''
        stderr:
          type: string
          title: Stderr
          default: ''
        file_ids:
          items:
            type: string
          type: array
          title: File Ids
          default: []
      type: object
      title: PythonToolDelta
    CustomToolStart:
      properties:
        type:
          type: string
          const: custom_tool_start
          title: Type
          default: custom_tool_start
        tool_name:
          type: string
          title: Tool Name
      type: object
      required:
        - tool_name
      title: CustomToolStart
    CustomToolDelta:
      properties:
        type:
          type: string
          const: custom_tool_delta
          title: Type
          default: custom_tool_delta
        tool_name:
          type: string
          title: Tool Name
        response_type:
          type: string
          title: Response Type
        data:
          anyOf:
            - additionalProperties: true
              type: object
            - items: {}
              type: array
            - type: string
            - type: integer
            - type: number
            - type: boolean
            - type: 'null'
          title: Data
        file_ids:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: File Ids
      type: object
      required:
        - tool_name
        - response_type
      title: CustomToolDelta
    ReasoningStart:
      properties:
        type:
          type: string
          const: reasoning_start
          title: Type
          default: reasoning_start
      type: object
      title: ReasoningStart
    ReasoningDelta:
      properties:
        type:
          type: string
          const: reasoning_delta
          title: Type
          default: reasoning_delta
        reasoning:
          type: string
          title: Reasoning
      type: object
      required:
        - reasoning
      title: ReasoningDelta
    ReasoningDone:
      properties:
        type:
          type: string
          const: reasoning_done
          title: Type
          default: reasoning_done
      type: object
      title: ReasoningDone
    CitationInfo:
      properties:
        type:
          type: string
          const: citation_info
          title: Type
          default: citation_info
        citation_number:
          type: integer
          title: Citation Number
        document_id:
          type: string
          title: Document Id
      type: object
      required:
        - citation_number
        - document_id
      title: CitationInfo
    DeepResearchPlanStart:
      properties:
        type:
          type: string
          const: deep_research_plan_start
          title: Type
          default: deep_research_plan_start
      type: object
      title: DeepResearchPlanStart
    DeepResearchPlanDelta:
      properties:
        type:
          type: string
          const: deep_research_plan_delta
          title: Type
          default: deep_research_plan_delta
        content:
          type: string
          title: Content
      type: object
      required:
        - content
      title: DeepResearchPlanDelta
    ResearchAgentStart:
      properties:
        type:
          type: string
          const: research_agent_start
          title: Type
          default: research_agent_start
        research_task:
          type: string
          title: Research Task
      type: object
      required:
        - research_task
      title: ResearchAgentStart
    IntermediateReportStart:
      properties:
        type:
          type: string
          const: intermediate_report_start
          title: Type
          default: intermediate_report_start
      type: object
      title: IntermediateReportStart
    IntermediateReportDelta:
      properties:
        type:
          type: string
          const: intermediate_report_delta
          title: Type
          default: intermediate_report_delta
        content:
          type: string
          title: Content
      type: object
      required:
        - content
      title: IntermediateReportDelta
    IntermediateReportCitedDocs:
      properties:
        type:
          type: string
          const: intermediate_report_cited_docs
          title: Type
          default: intermediate_report_cited_docs
        cited_docs:
          anyOf:
            - items:
                $ref: '#/components/schemas/SearchDoc'
              type: array
            - type: 'null'
          title: Cited Docs
      type: object
      title: IntermediateReportCitedDocs
    DocumentSource:
      type: string
      enum:
        - ingestion_api
        - slack
        - web
        - google_drive
        - gmail
        - requesttracker
        - github
        - gitbook
        - gitlab
        - guru
        - bookstack
        - outline
        - confluence
        - jira
        - slab
        - productboard
        - file
        - coda
        - notion
        - zulip
        - linear
        - hubspot
        - document360
        - gong
        - google_sites
        - zendesk
        - loopio
        - dropbox
        - sharepoint
        - teams
        - salesforce
        - discourse
        - axero
        - clickup
        - mediawiki
        - wikipedia
        - asana
        - s3
        - r2
        - google_cloud_storage
        - oci_storage
        - xenforo
        - not_applicable
        - discord
        - freshdesk
        - fireflies
        - egnyte
        - airtable
        - highspot
        - drupal_wiki
        - imap
        - bitbucket
        - testrail
        - mock_connector
        - user_file
      title: DocumentSource
    ChatFileType:
      type: string
      enum:
        - image
        - document
        - plain_text
        - csv
      title: ChatFileType
    SearchDoc:
      properties:
        document_id:
          type: string
          title: Document Id
        chunk_ind:
          type: integer
          title: Chunk Ind
        semantic_identifier:
          type: string
          title: Semantic Identifier
        link:
          anyOf:
            - type: string
            - type: 'null'
          title: Link
        blurb:
          type: string
          title: Blurb
        source_type:
          $ref: '#/components/schemas/DocumentSource'
        boost:
          type: integer
          title: Boost
        hidden:
          type: boolean
          title: Hidden
        metadata:
          additionalProperties:
            anyOf:
              - type: string
              - items:
                  type: string
                type: array
          type: object
          title: Metadata
        score:
          anyOf:
            - type: number
            - type: 'null'
          title: Score
        is_relevant:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Is Relevant
        relevance_explanation:
          anyOf:
            - type: string
            - type: 'null'
          title: Relevance Explanation
        match_highlights:
          items:
            type: string
          type: array
          title: Match Highlights
        updated_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Updated At
        primary_owners:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Primary Owners
        secondary_owners:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Secondary Owners
        is_internet:
          type: boolean
          title: Is Internet
          default: false
      type: object
      required:
        - document_id
        - chunk_ind
        - semantic_identifier
        - blurb
        - source_type
        - boost
        - hidden
        - metadata
        - match_highlights
      title: SearchDoc
    GeneratedImage:
      properties:
        file_id:
          type: string
          title: File Id
        url:
          type: string
          title: Url
        revised_prompt:
          type: string
          title: Revised Prompt
        shape:
          anyOf:
            - type: string
            - type: 'null'
          title: Shape
      type: object
      required:
        - file_id
        - url
        - revised_prompt
      title: GeneratedImage
      description: Represents an image generated by an image generation tool.
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: Authorization header with Bearer token

````