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.

GET /api/v1/history/usage
GET /api/v1/history/query

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

Usage History

GET /history/usage

Use Case 1: 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.

curl -X GET "https://api.harvey.ai/api/v1/history/usage?start_time=1711920000&end_time=1714521600" \
  -H "Authorization: Bearer YOUR_API_KEY"

Use Case 2: 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.

curl -X GET "https://api.harvey.ai/api/v1/history/usage?start_time=1711920000&end_time=1714521600" \
  -H "Authorization: Bearer YOUR_API_KEY"

Query History

GET /history/query

Use Case 1: 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.

curl -X GET "https://api.harvey.ai/api/v1/history/query?start_time=1711920000&end_time=1714521600" \
  -H "Authorization: Bearer YOUR_API_KEY"

Use Case 2: Reviewing Draft Quality and Sources

Challenge: Teams need to verify whether specific outputs were grounded in expected sources.

Solution: Use the documents and source fields to trace citation paths.

curl -X GET "https://api.harvey.ai/api/v1/history/query?start_time=1711920000&end_time=1714521600" \
  -H "Authorization: Bearer YOUR_API_KEY"

Best Practices

  • Limit to 30-day windows: The API supports a max range of 30 days
  • Align client-matter attribution: Combine query and usage logs with client_matter metadata to analyze usage patterns and client activity
  • Check task diversity: Use task to analyze how different Harvey features are used
  • Trace user activity contextually: Use email, timestamp, and documents fields to piece together how a user interacted with a specific document or feature

Error Handling

Status CodeDescriptionExample Error Message
200, 201SuccessN/A
400Bad Request – Missing or invalid input{ "error": "Missing start_time" }
401Unauthorized – Invalid API key{ "error": "Unauthorized" }
429Too Many Requests – Rate limit exceeded{ "error": "Rate limit exceeded" }
500Internal Server Error{ "error": "Unexpected server error" }

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