Upsert Clients
curl --request POST \
--url https://api.harvey.ai/api/v2/clients \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"clients": [
{
"client_id": "10022421",
"client_name": "Acme Corp"
}
]
}
'import requests
url = "https://api.harvey.ai/api/v2/clients"
payload = { "clients": [
{
"client_id": "10022421",
"client_name": "Acme Corp"
}
] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({clients: [{client_id: '10022421', client_name: 'Acme Corp'}]})
};
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 => "POST",
CURLOPT_POSTFIELDS => json_encode([
'clients' => [
[
'client_id' => '10022421',
'client_name' => 'Acme Corp'
]
]
]),
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 \"clients\": [\n {\n \"client_id\": \"10022421\",\n \"client_name\": \"Acme Corp\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.harvey.ai/api/v2/clients")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"clients\": [\n {\n \"client_id\": \"10022421\",\n \"client_name\": \"Acme Corp\"\n }\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::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"clients\": [\n {\n \"client_id\": \"10022421\",\n \"client_name\": \"Acme Corp\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"created": [
{
"client_id": "10022421",
"client_name": "Acme Corp"
}
],
"updated": [],
"errors": []
}Upsert
Upsert Clients
Creates or updates clients using your firm’s client identifiers. Submit 1 to 10,000 clients per request.
POST
/
api
/
v2
/
clients
Upsert Clients
curl --request POST \
--url https://api.harvey.ai/api/v2/clients \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"clients": [
{
"client_id": "10022421",
"client_name": "Acme Corp"
}
]
}
'import requests
url = "https://api.harvey.ai/api/v2/clients"
payload = { "clients": [
{
"client_id": "10022421",
"client_name": "Acme Corp"
}
] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({clients: [{client_id: '10022421', client_name: 'Acme Corp'}]})
};
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 => "POST",
CURLOPT_POSTFIELDS => json_encode([
'clients' => [
[
'client_id' => '10022421',
'client_name' => 'Acme Corp'
]
]
]),
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 \"clients\": [\n {\n \"client_id\": \"10022421\",\n \"client_name\": \"Acme Corp\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.harvey.ai/api/v2/clients")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"clients\": [\n {\n \"client_id\": \"10022421\",\n \"client_name\": \"Acme Corp\"\n }\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::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"clients\": [\n {\n \"client_id\": \"10022421\",\n \"client_name\": \"Acme Corp\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"created": [
{
"client_id": "10022421",
"client_name": "Acme Corp"
}
],
"updated": [],
"errors": []
}Permissions
Requires Client matters admin (write:client_matters).
Matching and results
A live or soft-deleted client with the same trimmedclient_id is updated or restored. Matched clients appear in updated, even when their fields do not change. New clients appear in created.
HTTP 200 can include row failures in errors; valid rows still succeed. A repeated identifier in the batch produces duplicate_client_id for the later row.
See the Client Matters guide for examples and migration steps.Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
Required array length:
1 - 10000 elementsShow child attributes
Show child attributes