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

# Get Usage History

> Fetches the usage history and metadata for a specified time range. Includes query events from your workspace users across Harvey product areas. The data includes basic metadata like user, timestamp and event kind. 

It does **not** include sensitive information such as inputs to or outputs from the AI system.


### Permissions

Requires `Territory admin` or `Organization admin` permission.


## OpenAPI

````yaml /history_export_api.json get /api/v1/history/usage
openapi: 3.0.1
info:
  title: v2 - Harvey History Export API
  description: >
    The Harvey API enables customers to fetch query and workspace history for
    their workspace. This includes query events and usage history with relevant
    metadata.
  version: 2.0.0
  contact:
    email: support@harvey.ai
servers:
  - url: https://api.harvey.ai
    description: Harvey API server
security: []
paths:
  /api/v1/history/usage:
    get:
      tags:
        - Usage
      summary: Get Usage History
      description: >
        Fetches the usage history and metadata for a specified time range.
        Includes query events from your workspace users across Harvey product
        areas. The data includes basic metadata like user, timestamp and event
        kind. 


        It does **not** include sensitive information such as inputs to or
        outputs from the AI system.
      operationId: getUsageHistory
      parameters:
        - name: start_time
          in: query
          required: true
          schema:
            type: integer
            format: date-time
            description: UTC epoch timestamp, up to 1 year ago from now
        - name: end_time
          in: query
          required: true
          schema:
            type: integer
            format: date-time
            description: >-
              UTC epoch timestamp, up to 30 days from start_time. Note: The API
              supports a maximum range of 30 days, but it's best to retrieve a
              max of one day at a time on a regular cadence.
      responses:
        '200':
          description: Array of events with UsageHistory entries
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/UsageHistory'
        '400':
          description: Bad request.
        '401':
          description: Unauthorized.
        '429':
          description: Rate limit exceeded.
        '500':
          description: Internal server error.
      security:
        - bearerAuth: []
components:
  schemas:
    UsageHistory:
      type: object
      properties:
        event_id:
          type: integer
          description: Unique identifier for the usage event.
          example: 103230489
        message_ID:
          type: string
          format: uuid
          description: ID of the message.
          example: ab12a1ab-abcd-1a12-1234-1234ab123456
        Time:
          type: string
          format: date-time
          description: Timestamp of the event.
          example: '2024-09-03T14:47:12.000Z'
        User:
          type: string
          description: Email of the user who triggered the event.
          example: user@example.com
        Task:
          type: string
          description: Type of query.
          enum:
            - Assist
            - Company Profile
            - Draft
            - Redlines Issues List
            - Redlines Q&A
            - Translation
            - Vault Review
            - Workflows
          example: Assist
        'Client Matter #':
          type: string
          description: Client matter ID, if exists.
          example: 1234.56
        Source:
          type: string
          description: Source of the event.
          enum:
            - Files
            - EDGAR
            - EUR-Lex
            - Vault
          example: Files
        Number of documents:
          type: integer
          description: Sum of all uploaded documents
          example: 5
        Feedback Comments:
          type: array
          items:
            type: string
          description: >-
            Description of negative feedback - can be all or any of
            Hallucination, Incomplete response, Poor formatting, Something else.
            Only Negative Feedback can have comments.
          example: Incomplete response
        Feedback Sentiment:
          type: string
          description: >-
            The sentiment of the feedback given, if any, either Positive or
            Negative.
          example: negative
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````