Skip to main content
GET
/
api
/
v1
/
history
/
usage
Get Usage History
curl --request GET \
  --url https://api.harvey.ai/api/v1/history/usage \
  --header 'Authorization: Bearer <token>'
import requests

url = "https://api.harvey.ai/api/v1/history/usage"

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/usage', 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/usage",
  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/usage"

	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/usage")
  .header("Authorization", "Bearer <token>")
  .asString();
require 'uri'
require 'net/http'

url = URI("https://api.harvey.ai/api/v1/history/usage")

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,
    "message_ID": "ab12a1ab-abcd-1a12-1234-1234ab123456",
    "Time": "2024-09-03T14:47:12.000Z",
    "User": "user@example.com",
    "Task": "Assist",
    "Client Matter #": 1234.56,
    "Source": "Files",
    "Number of documents": 5,
    "Feedback Comments": "Incomplete response",
    "Feedback Sentiment": "negative"
  }
]

Permissions

Requires Territory admin or Organization admin permission.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Query Parameters

start_time
integer<date-time>
required

UTC epoch timestamp, up to 1 year ago from now

end_time
integer<date-time>
required

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.

Response

Array of events with UsageHistory entries

event_id
integer

Unique identifier for the usage event.

Example:

103230489

message_ID
string<uuid>

ID of the message.

Example:

"ab12a1ab-abcd-1a12-1234-1234ab123456"

Time
string<date-time>

Timestamp of the event.

Example:

"2024-09-03T14:47:12.000Z"

User
string

Email of the user who triggered the event.

Example:

"user@example.com"

Task
enum<string>

Type of query.

Available options:
Assist,
Company Profile,
Draft,
Redlines Issues List,
Redlines Q&A,
Translation,
Vault Review,
Workflows
Example:

"Assist"

Client Matter #
string

Client matter ID, if exists.

Example:

1234.56

Source
enum<string>

Source of the event.

Available options:
Files,
EDGAR,
EUR-Lex,
Vault
Example:

"Files"

Number of documents
integer

Sum of all uploaded documents

Example:

5

Feedback Comments
string[]

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
string

The sentiment of the feedback given, if any, either Positive or Negative.

Example:

"negative"