curl --request GET \
--url https://api.harvey.ai/api/v1/history/query \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.harvey.ai/api/v1/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/v1/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/v1/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/v1/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/v1/history/query")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.harvey.ai/api/v1/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[
{
"event_id": 103230489,
"Time": "2024-09-03T14:47:12.000Z",
"User": "user@example.com",
"Task": "Assist",
"Client Matter #": 1234.56,
"Source": "Files",
"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. Limitation of liability clauses cap the amount or types of damages one party can recover from the other, often excluding indirect or consequential losses. Together, these clauses allocate and manage risk between the parties, providing predictability and protecting against potentially catastrophic financial exposure.",
"Documents": "2025_IP_Licensing_Terms_Redline_vs_2024.docx",
"Number of documents": 1,
"Link": "https://app.harvey.ai/assistant/assist/123456789"
}
]Get Query History
Fetches the query history and metadata for a specified time range, including sensitive information such as inputs to and outputs from the AI system.
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.
curl --request GET \
--url https://api.harvey.ai/api/v1/history/query \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.harvey.ai/api/v1/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/v1/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/v1/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/v1/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/v1/history/query")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.harvey.ai/api/v1/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[
{
"event_id": 103230489,
"Time": "2024-09-03T14:47:12.000Z",
"User": "user@example.com",
"Task": "Assist",
"Client Matter #": 1234.56,
"Source": "Files",
"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. Limitation of liability clauses cap the amount or types of damages one party can recover from the other, often excluding indirect or consequential losses. Together, these clauses allocate and manage risk between the parties, providing predictability and protecting against potentially catastrophic financial exposure.",
"Documents": "2025_IP_Licensing_Terms_Redline_vs_2024.docx",
"Number of documents": 1,
"Link": "https://app.harvey.ai/assistant/assist/123456789"
}
]Permissions
RequiresAccess Sensitive Usage History via API permission. If this permission is not available to select, contact support@harvey.ai.Authorizations
Query Parameters
Response
Array of events with QueryHistory entries
Response for the query.
"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. Limitation of liability clauses cap the amount or types of damages one party can recover from the other, often excluding indirect or consequential losses. Together, these clauses allocate and manage risk between the parties, providing predictability and protecting against potentially catastrophic financial exposure."