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

# History

> Read session chat turns from the durable Hub history, including pending turns.



## OpenAPI

````yaml /api-reference/openapi.json get /api/public/v1/intelligence-hub/sessions/{session_id}/chat/history
openapi: 3.1.0
info:
  title: User Intuition Public API
  description: >-
    ## Public Integration API


    Programmatic access to User Intuition for external integrators: manage
    studies, participants, interviews, reports, and panels.


    ### Authentication


    All endpoints require a Bearer token — either an API key (prefixed `ui_sk_`,
    created in the dashboard) or a dashboard JWT:


    ```

    Authorization: Bearer <ui_sk_… or JWT>

    ```


    ### Base URLs


    - **Production:** `https://api.userintuition.ai`

    - **Staging:** `https://staging.userintuition.ai`


    ### Support


    For API support, contact support@userintuition.ai
  version: 1.0.0
  contact:
    name: User Intuition Support
    email: support@userintuition.ai
servers:
  - url: https://api.userintuition.ai
    description: Production
  - url: https://staging.userintuition.ai
    description: Staging
security:
  - BearerAuth: []
paths:
  /api/public/v1/intelligence-hub/sessions/{session_id}/chat/history:
    get:
      tags:
        - public-intelligence-hub
      summary: History
      description: >-
        Read session chat turns from the durable Hub history, including pending
        turns.
      operationId: listHubChatHistory
      parameters:
        - name: session_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Session Id
        - name: after
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: uuid
              - type: 'null'
            title: After
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            maximum: 200
            minimum: 1
            default: 50
            title: Limit
        - name: X-UI-Organization-ID
          in: header
          required: false
          schema:
            anyOf:
              - type: string
                maxLength: 128
              - type: 'null'
            description: >-
              Platform admins only: choose an organization for scoped reads and
              writes. Required to change another organization's study or use its
              wallet.
            title: X-Ui-Organization-Id
          description: >-
            Platform admins only: choose an organization for scoped reads and
            writes. Required to change another organization's study or use its
            wallet.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HubChatHistory'
        '422':
          description: Public API error. X-Request-ID matches error.request_id.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicApiErrorResponse'
        default:
          description: Public API error. X-Request-ID matches error.request_id.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicApiErrorResponse'
components:
  schemas:
    HubChatHistory:
      properties:
        history:
          items:
            $ref: '#/components/schemas/HubChatEntry'
          type: array
          title: History
        next_cursor:
          anyOf:
            - type: string
            - type: 'null'
          title: Next Cursor
      type: object
      required:
        - history
      title: HubChatHistory
    PublicApiErrorResponse:
      type: object
      required:
        - detail
        - error
      properties:
        detail:
          description: Legacy error detail; may be a string, list, or object.
        error:
          $ref: '#/components/schemas/PublicApiError'
    HubChatEntry:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        message:
          type: string
          title: Message
        response:
          anyOf:
            - type: string
            - type: 'null'
          title: Response
        status:
          type: string
          title: Status
        references:
          items:
            $ref: '#/components/schemas/HubReference'
          type: array
          title: References
        created_at:
          type: string
          format: date-time
          title: Created At
      type: object
      required:
        - id
        - message
        - status
        - created_at
      title: HubChatEntry
    PublicApiError:
      type: object
      required:
        - code
        - message
        - field
        - request_id
        - outcome
        - recovery_action
        - docs_url
      properties:
        code:
          type: string
        message:
          type: string
        field:
          anyOf:
            - type: string
            - type: 'null'
        request_id:
          type: string
          format: uuid
        outcome:
          type: string
          enum:
            - not_started
            - failed
            - unknown
        recovery_action:
          type: string
        docs_url:
          type: string
          format: uri
    HubReference:
      properties:
        label:
          type: string
          title: Label
        study_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Study Id
        interview_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Interview Id
        source_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Source Id
        message_index:
          anyOf:
            - type: integer
            - type: 'null'
          title: Message Index
        page:
          anyOf:
            - type: integer
            - type: 'null'
          title: Page
        quote:
          type: string
          title: Quote
      type: object
      required:
        - label
        - quote
      title: HubReference
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: >-
        Authenticate with an API key (prefixed `ui_sk_`) or a JWT token from the
        dashboard.

````

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