curl --request GET \
--url https://api.harvey.ai/api/v1/agent_threads/{thread_id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.harvey.ai/api/v1/agent_threads/{thread_id}"
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/agent_threads/{thread_id}', 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/agent_threads/{thread_id}",
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/agent_threads/{thread_id}"
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/agent_threads/{thread_id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.harvey.ai/api/v1/agent_threads/{thread_id}")
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_bodyGet Agent Thread
Returns a thread’s current status, and once it has finished, the agent’s answer, its citations, and any files it generated.
Returns 200 for every thread you can read, including one still running. Poll until status is terminal rather than matching a specific non-terminal value.
curl --request GET \
--url https://api.harvey.ai/api/v1/agent_threads/{thread_id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.harvey.ai/api/v1/agent_threads/{thread_id}"
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/agent_threads/{thread_id}', 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/agent_threads/{thread_id}",
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/agent_threads/{thread_id}"
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/agent_threads/{thread_id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.harvey.ai/api/v1/agent_threads/{thread_id}")
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_bodyPermissions
RequiresAgents and workflows API and Use agents and workflows permissions. If these permissions are not available to select, contact support@harvey.ai.Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
The unique identifier of the agent thread.
Response
The thread, with its answer once it has finished
A thread and the agent run it holds.
The unique identifier of the agent thread.
Lifecycle state of a thread. COMPLETED, ERRORED and CANCELLED are terminal.
PENDING, IN_PROGRESS, COMPLETED, ERRORED, CANCELLED The agent this thread ran. Null until the agent begins executing.
The client matter this thread is attributed to, as a UUID, even if you supplied a name. Null when none was supplied.
Link to the thread in the Harvey web app, for handing the work to a person.
When the thread was created.
What the agent produced. Null until status is terminal, and on a thread that produced no answer.
Show child attributes
Show child attributes
Why the thread did not complete. Null unless status is ERRORED or CANCELLED.
The documents you attached, each with the processing status recorded for it. Generated files live under output.files instead.
Show child attributes
Show child attributes