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

# Get User History

> Retrieves the conversation history for a single user.

Args:
    request: Contains user_id and optional session_timeout_seconds (default: 3600)

Returns:
    HistoryResponse: List of formatted messages for the user



## OpenAPI

````yaml https://services.staging.app.dados.rio/eai-agent/openapi.json post /api/v1/eai-gateway/history
openapi: 3.1.0
info:
  title: Agentic Search API
  description: >-
    API que gerencia os fluxos e ferramentas dos agentes de IA da Prefeitura do
    Rio de Janeiro
  version: 0.1.0
servers:
  - url: https://services.staging.app.dados.rio/eai-agent
    description: Staging
security: []
paths:
  /api/v1/eai-gateway/history:
    post:
      tags:
        - EAI Gateway
      summary: Get User History
      description: |-
        Retrieves the conversation history for a single user.

        Args:
            request: Contains user_id and optional session_timeout_seconds (default: 3600)

        Returns:
            HistoryResponse: List of formatted messages for the user
      operationId: get_user_history_api_v1_eai_gateway_history_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/HistoryRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HistoryResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - HTTPBearer: []
components:
  schemas:
    HistoryRequest:
      properties:
        user_id:
          type: string
          title: User Id
        session_timeout_seconds:
          type: integer
          title: Session Timeout Seconds
          default: 3600
        use_whatsapp_format:
          type: boolean
          title: Use Whatsapp Format
          default: false
      type: object
      required:
        - user_id
      title: HistoryRequest
    HistoryResponse:
      properties:
        data:
          items:
            additionalProperties: true
            type: object
          type: array
          title: Data
      type: object
      required:
        - data
      title: HistoryResponse
    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

````