Skip to main content
Harvey’s History Export APIs let you retrieve detailed logs of how users are interacting with the platform. Use them to power usage reports, perform compliance investigations, or attribute activity to clients and matters.
The current API request rate limits for History Export API endpoints are 2 requests per minute.

Overview

The History APIs support:
  • Usage Tracking: Understand frequency, volume, and system-wide adoption
  • Query Forensics: Review exact prompts, outputs, and sources for internal audits or client escalations
  • Billing & Cost Attribution: Map usage and queries back to client-matter structures
The v2 endpoints return enriched event data with additional metadata such as product_surface_area, subsurface, vault_project_name, and more. We recommend using v2 for all new integrations.
These APIs include sensitive data for resource names across your entire workspace, and are not gated by any form of client-matter or ethical wall boundaries.We recommend caution when pulling this information via API and sharing API tokens carefully and selectively.

What’s new in v2

  • Workflow, playbook, and vault names to identify commonly used resources
  • Unique usage id (uuid) for every single usage log returned by the API
  • Clear distinction between creation vs. run for playbooks and workflows
  • Clear distinction between starting new threads vs. asking follow-up queries

Event Types

Each v2 history event includes a product_surface_area and subsurface field that identify where and how the event occurred. Below is a complete list of possible values.

Product Surface Area

Subsurface


Usage History

v2

Returns usage events wrapped in an events array. Each event includes metadata about the product area, action type, and user — without sensitive inputs or outputs.
Example response:

v1

Returns a flat array of usage events with basic metadata.

Use Cases

Usage Reporting and Oversight

Challenge: Firms need reliable, exportable usage metrics to support leadership reporting and billing. Solution: Pull usage data weekly or monthly and load it into your reporting environment. Use the product_surface_area field (v2) or Task field (v1) to break down usage by Harvey product.

Monitoring Adoption Across Teams

Challenge: Legal and operational leaders need to understand how teams are engaging with Harvey. Solution: Pull usage logs and associate them with user emails or internal department mappings. The v2 endpoint provides additional context through subsurface and access_point fields.

Query History

v2

Returns query events wrapped in an events array. Each event includes the full query and response text alongside all usage metadata.
Example response:

v1

Returns a flat array of query events including prompts, responses, and document references.

Use Cases

Deep Dive Analysis of Specific Queries

Challenge: Admins need to understand exactly what was asked, by whom, and what sources were used. Solution: Use query history logs to reconstruct an interaction. The v2 link field provides a direct URL to view the event in Harvey.

Reviewing Draft Quality and Sources

Challenge: Teams need to verify whether specific outputs were grounded in expected sources. Solution: Use the source and response fields (v2) to trace how the AI formulated its answer. In v1, the Documents field lists specific filenames used.

Best Practices

  • Limit to 1-day data pulls: 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.
  • Align client-matter attribution: Combine query and usage logs with client-matter metadata to analyze usage patterns and client activity. Use cm_id (v2) or Client Matter # (v1) to match events.
  • Analyze product usage: Use product_surface_area and subsurface (v2) or Task (v1) to understand how different Harvey features are used.
  • Trace user activity contextually: Use email, timestamp, and source fields to piece together how a user interacted with a specific document or feature.

Error Handling


Need help getting started? Contact your Harvey Customer Success Manager for more information.