curl --request DELETE \
--url https://api.harvey.ai/api/v2/clients \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"client_ids": [
"10022421",
"10022422"
]
}
'import requests
url = "https://api.harvey.ai/api/v2/clients"
payload = { "client_ids": ["10022421", "10022422"] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.delete(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'DELETE',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({client_ids: ['10022421', '10022422']})
};
fetch('https://api.harvey.ai/api/v2/clients', 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/clients",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_POSTFIELDS => json_encode([
'client_ids' => [
'10022421',
'10022422'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.harvey.ai/api/v2/clients"
payload := strings.NewReader("{\n \"client_ids\": [\n \"10022421\",\n \"10022422\"\n ]\n}")
req, _ := http.NewRequest("DELETE", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("https://api.harvey.ai/api/v2/clients")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"client_ids\": [\n \"10022421\",\n \"10022422\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.harvey.ai/api/v2/clients")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"client_ids\": [\n \"10022421\",\n \"10022422\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"deleted": [
{
"client_id": "10022421"
}
],
"already_absent": [],
"errors": []
}Delete Clients
Soft-deletes clients by your firm’s client identifiers. Submit 1 to 10,000 identifiers per request. Each identifier receives one result in deleted, already_absent, or errors. Inspect errors even when the response is HTTP 200. Missing and already-deleted clients appear in already_absent. A client that still has a matter that is not deleted fails with client_has_matters. Delete its matters with DELETE /api/v2/matters first. This endpoint does not change matters.
curl --request DELETE \
--url https://api.harvey.ai/api/v2/clients \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"client_ids": [
"10022421",
"10022422"
]
}
'import requests
url = "https://api.harvey.ai/api/v2/clients"
payload = { "client_ids": ["10022421", "10022422"] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.delete(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'DELETE',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({client_ids: ['10022421', '10022422']})
};
fetch('https://api.harvey.ai/api/v2/clients', 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/clients",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_POSTFIELDS => json_encode([
'client_ids' => [
'10022421',
'10022422'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.harvey.ai/api/v2/clients"
payload := strings.NewReader("{\n \"client_ids\": [\n \"10022421\",\n \"10022422\"\n ]\n}")
req, _ := http.NewRequest("DELETE", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("https://api.harvey.ai/api/v2/clients")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"client_ids\": [\n \"10022421\",\n \"10022422\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.harvey.ai/api/v2/clients")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"client_ids\": [\n \"10022421\",\n \"10022422\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"deleted": [
{
"client_id": "10022421"
}
],
"already_absent": [],
"errors": []
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
Submit the client_id values to delete. Unknown fields return HTTP 400 with invalid_request.
The firm's client identifiers, the client_id values used in v2 upserts. Not client labels or Harvey client UUIDs. Surrounding whitespace is trimmed.
1 - 10000 elementsResponse
Per-identifier results for the submitted clients.
Every identifier in the request has one result. Within each array, results keep the order of the request.