Get Query History (v2)
curl --request GET \
--url https://api.harvey.ai/api/v2/history/query \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.harvey.ai/api/v2/history/query"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.harvey.ai/api/v2/history/query', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.harvey.ai/api/v2/history/query",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.harvey.ai/api/v2/history/query"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.harvey.ai/api/v2/history/query")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.harvey.ai/api/v2/history/query")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"events": [
{
"access_point": "WEB",
"action": "CREATE",
"cm_id": "1234.56",
"feedback_comments": "",
"feedback_sentiments": "",
"file_ids": [
"019d35f0-4cf5-7296-aef5-45991d83a77b",
"019d35f0-4cf1-7f4f-a09b-885f9066638e"
],
"files_metadata": [
{
"id": "019d35f0-4cf5-7296-aef5-45991d83a77b",
"role": "user_attached",
"source": "file_upload"
},
{
"id": "019d35f0-4cf1-7f4f-a09b-885f9066638e",
"role": "generated"
}
],
"link": "https://app.harvey.ai/assistant/assist/2374992",
"parent_thread_id": 2374992,
"playbook_name": "",
"playbook_id": "",
"product_surface_area": "ASSISTANT",
"query": "In 3 sentences, can you explain how indemnity and limitation of liability clauses typically work in commercial contracts?",
"response": "Indemnity clauses in commercial contracts require one party to compensate the other for certain losses or damages arising from specified events, such as breaches or third-party claims.",
"review_table_name": "Supply Agreement Details and Key Terms",
"review_table_id": "019c85a7-a7c9-784f-bc59-0ddd5654274d",
"source": "Files",
"space_name": "",
"space_id": "",
"subsurface": "ASSISTANT_THREAD, ASSISTANT_THREAD_FOLLOWUP",
"title": "",
"utc_time": "2026-02-22 14:01:23",
"unique_usage_id": "019c85a7-a7c9-784f-bc59-0ddd5654274d",
"user": "user@example.com",
"vault_project_name": "48CommercialContracts",
"vault_project_id": "019c85a7-a7c9-784f-bc59-0ddd5654274d",
"workflow_name": "",
"workflow_id": "",
"agent_ids": [
"00000000-0000-4000-8000-000000000010",
"00000000-0000-4000-8000-000000000020"
],
"agent_names": [
"Contract Review",
null
],
"template_ids": [
"00000000-0000-4000-8000-000000000030"
],
"template_names": [
"Board Memo"
],
"workspace_id": 1234,
"metadata": {
"num_columns": 5,
"num_files": 48
}
}
]
}Queries
Get Query History (v2)
Fetches the query history and metadata for a specified time range, including sensitive information such as inputs to and outputs from the AI system. Returns enriched event data with product surface area, subsurface details, and additional metadata.
Warning: 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.
GET
/
api
/
v2
/
history
/
query
Get Query History (v2)
curl --request GET \
--url https://api.harvey.ai/api/v2/history/query \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.harvey.ai/api/v2/history/query"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.harvey.ai/api/v2/history/query', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.harvey.ai/api/v2/history/query",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.harvey.ai/api/v2/history/query"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.harvey.ai/api/v2/history/query")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.harvey.ai/api/v2/history/query")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"events": [
{
"access_point": "WEB",
"action": "CREATE",
"cm_id": "1234.56",
"feedback_comments": "",
"feedback_sentiments": "",
"file_ids": [
"019d35f0-4cf5-7296-aef5-45991d83a77b",
"019d35f0-4cf1-7f4f-a09b-885f9066638e"
],
"files_metadata": [
{
"id": "019d35f0-4cf5-7296-aef5-45991d83a77b",
"role": "user_attached",
"source": "file_upload"
},
{
"id": "019d35f0-4cf1-7f4f-a09b-885f9066638e",
"role": "generated"
}
],
"link": "https://app.harvey.ai/assistant/assist/2374992",
"parent_thread_id": 2374992,
"playbook_name": "",
"playbook_id": "",
"product_surface_area": "ASSISTANT",
"query": "In 3 sentences, can you explain how indemnity and limitation of liability clauses typically work in commercial contracts?",
"response": "Indemnity clauses in commercial contracts require one party to compensate the other for certain losses or damages arising from specified events, such as breaches or third-party claims.",
"review_table_name": "Supply Agreement Details and Key Terms",
"review_table_id": "019c85a7-a7c9-784f-bc59-0ddd5654274d",
"source": "Files",
"space_name": "",
"space_id": "",
"subsurface": "ASSISTANT_THREAD, ASSISTANT_THREAD_FOLLOWUP",
"title": "",
"utc_time": "2026-02-22 14:01:23",
"unique_usage_id": "019c85a7-a7c9-784f-bc59-0ddd5654274d",
"user": "user@example.com",
"vault_project_name": "48CommercialContracts",
"vault_project_id": "019c85a7-a7c9-784f-bc59-0ddd5654274d",
"workflow_name": "",
"workflow_id": "",
"agent_ids": [
"00000000-0000-4000-8000-000000000010",
"00000000-0000-4000-8000-000000000020"
],
"agent_names": [
"Contract Review",
null
],
"template_ids": [
"00000000-0000-4000-8000-000000000030"
],
"template_names": [
"Board Memo"
],
"workspace_id": 1234,
"metadata": {
"num_columns": 5,
"num_files": 48
}
}
]
}Permissions
RequiresAccess Sensitive Usage History via API permission. If this permission is not available to select, contact support@harvey.ai.