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

# Get session history

> Get message history for a specific session.



## OpenAPI

````yaml /docs/reference/openapi.json get /sessions/{session_id}/history
openapi: 3.1.0
info:
  description: >-
    The HTTP API of an agent served with `omniserve run --agent agent.py`: runs,
    approvals, budgets, background tasks, sessions and the evidence of every
    run.
  title: OmniServe
  version: latest
servers:
  - description: omniserve run, locally
    url: http://localhost:8000
security: []
paths:
  /sessions/{session_id}/history:
    get:
      tags:
        - Sessions
      summary: Get session history
      description: Get message history for a specific session.
      operationId: get_session_history_sessions__session_id__history_get
      parameters:
        - in: path
          name: session_id
          required: true
          schema:
            title: Session Id
            type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SessionHistoryResponse'
          description: Successful Response
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: Validation Error
components:
  schemas:
    SessionHistoryResponse:
      description: Response model for session history endpoint.
      properties:
        count:
          description: Number of messages
          title: Count
          type: integer
        messages:
          description: Message history
          items:
            additionalProperties: true
            type: object
          title: Messages
          type: array
        session_id:
          description: Session ID
          title: Session Id
          type: string
      required:
        - session_id
        - messages
        - count
      title: SessionHistoryResponse
      type: object
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          title: Detail
          type: array
      title: HTTPValidationError
      type: object
    ValidationError:
      properties:
        ctx:
          title: Context
          type: object
        input:
          title: Input
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          title: Location
          type: array
        msg:
          title: Message
          type: string
        type:
          title: Error Type
          type: string
      required:
        - loc
        - msg
        - type
      title: ValidationError
      type: object

````