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

# List Context History



## OpenAPI

````yaml /development/api-reference/openapi.json get /api/v1/contexts/{context_id}/history
openapi: 3.1.0
info:
  title: Agentstack server
  version: 0.6.3
servers: []
security: []
paths:
  /api/v1/contexts/{context_id}/history:
    get:
      tags:
        - contexts
      summary: List Context History
      operationId: list_context_history_api_v1_contexts__context_id__history_get
      parameters:
        - name: context_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Context Id
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            maximum: 100
            minimum: 1
            title: Limit
        - name: page_token
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: uuid
              - type: 'null'
            title: Page Token
        - name: order
          in: query
          required: false
          schema:
            type: string
            pattern: ^(asc|desc)$
            title: Order
        - name: order_by
          in: query
          required: false
          schema:
            type: string
            pattern: ^created_at|updated_at$
            title: Order By
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedResult_ContextHistoryItem_'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - HTTPBasic: []
        - HTTPBearer: []
components:
  schemas:
    PaginatedResult_ContextHistoryItem_:
      properties:
        items:
          items:
            $ref: '#/components/schemas/ContextHistoryItem'
          type: array
          title: Items
        total_count:
          type: integer
          title: Total Count
        has_more:
          type: boolean
          title: Has More
          default: false
        next_page_token:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Next Page Token
          readOnly: true
      type: object
      required:
        - items
        - total_count
        - next_page_token
      title: PaginatedResult[ContextHistoryItem]
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ContextHistoryItem:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        data:
          $ref: '#/components/schemas/ContextHistoryItemData-Output'
        created_at:
          type: string
          format: date-time
          title: Created At
        context_id:
          type: string
          format: uuid
          title: Context Id
        kind:
          type: string
          enum:
            - message
            - artifact
          title: Kind
          readOnly: true
      type: object
      required:
        - data
        - context_id
        - kind
      title: ContextHistoryItem
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    ContextHistoryItemData-Output:
      anyOf:
        - $ref: '#/components/schemas/Artifact-Output'
        - $ref: '#/components/schemas/Message-Output'
    Artifact-Output:
      properties:
        artifactId:
          type: string
          title: Artifactid
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
        extensions:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Extensions
        metadata:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Metadata
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
        parts:
          items:
            $ref: '#/components/schemas/Part-Output'
          type: array
          title: Parts
      type: object
      required:
        - artifactId
        - parts
      title: Artifact
      description: >-
        Represents a file, data structure, or other resource generated by an
        agent during a task.
    Message-Output:
      properties:
        contextId:
          anyOf:
            - type: string
            - type: 'null'
          title: Contextid
        extensions:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Extensions
        kind:
          type: string
          const: message
          title: Kind
          default: message
        messageId:
          type: string
          title: Messageid
        metadata:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Metadata
        parts:
          items:
            $ref: '#/components/schemas/Part-Output'
          type: array
          title: Parts
        referenceTaskIds:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Referencetaskids
        role:
          $ref: '#/components/schemas/Role'
        taskId:
          anyOf:
            - type: string
            - type: 'null'
          title: Taskid
      type: object
      required:
        - messageId
        - parts
        - role
      title: Message
      description: >-
        Represents a single message in the conversation between a user and an
        agent.
    Part-Output:
      anyOf:
        - $ref: '#/components/schemas/TextPart'
        - $ref: '#/components/schemas/FilePart'
        - $ref: '#/components/schemas/DataPart'
      title: Part
    Role:
      type: string
      enum:
        - agent
        - user
      title: Role
      description: >-
        Identifies the sender of the message. `user` for the client, `agent` for
        the service.
    TextPart:
      properties:
        kind:
          type: string
          const: text
          title: Kind
          default: text
        metadata:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Metadata
        text:
          type: string
          title: Text
      type: object
      required:
        - text
      title: TextPart
      description: Represents a text segment within a message or artifact.
    FilePart:
      properties:
        file:
          anyOf:
            - $ref: '#/components/schemas/FileWithBytes'
            - $ref: '#/components/schemas/FileWithUri'
          title: File
        kind:
          type: string
          const: file
          title: Kind
          default: file
        metadata:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Metadata
      type: object
      required:
        - file
      title: FilePart
      description: >-
        Represents a file segment within a message or artifact. The file content
        can be

        provided either directly as bytes or as a URI.
    DataPart:
      properties:
        data:
          additionalProperties: true
          type: object
          title: Data
        kind:
          type: string
          const: data
          title: Kind
          default: data
        metadata:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Metadata
      type: object
      required:
        - data
      title: DataPart
      description: >-
        Represents a structured data segment (e.g., JSON) within a message or
        artifact.
    FileWithBytes:
      properties:
        bytes:
          type: string
          title: Bytes
        mimeType:
          anyOf:
            - type: string
            - type: 'null'
          title: Mimetype
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
      type: object
      required:
        - bytes
      title: FileWithBytes
      description: >-
        Represents a file with its content provided directly as a base64-encoded
        string.
    FileWithUri:
      properties:
        mimeType:
          anyOf:
            - type: string
            - type: 'null'
          title: Mimetype
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
        uri:
          type: string
          title: Uri
      type: object
      required:
        - uri
      title: FileWithUri
      description: Represents a file with its content located at a specific URI.
  securitySchemes:
    HTTPBasic:
      type: http
      scheme: basic
    HTTPBearer:
      type: http
      scheme: bearer

````