curl --request DELETE \
--url https://api.harvey.ai/api/v2/matters \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"matters": [
{
"client_id": "10022421",
"matter_id": "M001"
},
{
"client_id": "10022421",
"matter_id": "M002"
}
]
}
'import requests
url = "https://api.harvey.ai/api/v2/matters"
payload = { "matters": [
{
"client_id": "10022421",
"matter_id": "M001"
},
{
"client_id": "10022421",
"matter_id": "M002"
}
] }
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({
matters: [
{client_id: '10022421', matter_id: 'M001'},
{client_id: '10022421', matter_id: 'M002'}
]
})
};
fetch('https://api.harvey.ai/api/v2/matters', 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/matters",
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([
'matters' => [
[
'client_id' => '10022421',
'matter_id' => 'M001'
],
[
'client_id' => '10022421',
'matter_id' => 'M002'
]
]
]),
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/matters"
payload := strings.NewReader("{\n \"matters\": [\n {\n \"client_id\": \"10022421\",\n \"matter_id\": \"M001\"\n },\n {\n \"client_id\": \"10022421\",\n \"matter_id\": \"M002\"\n }\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/matters")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"matters\": [\n {\n \"client_id\": \"10022421\",\n \"matter_id\": \"M001\"\n },\n {\n \"client_id\": \"10022421\",\n \"matter_id\": \"M002\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.harvey.ai/api/v2/matters")
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 \"matters\": [\n {\n \"client_id\": \"10022421\",\n \"matter_id\": \"M001\"\n },\n {\n \"client_id\": \"10022421\",\n \"matter_id\": \"M002\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"deleted": [
{
"client_id": "10022421",
"matter_id": "M001"
}
],
"already_absent": [],
"errors": []
}Delete Matters
Soft-deletes matters by your firm’s client and matter identifiers. Submit 1 to 10,000 pairs per request. Each pair receives one result in deleted, already_absent, or errors. Inspect errors even when the response is HTTP 200. Missing and already-deleted matters appear in already_absent. Externally linked matters cannot be deleted while ethical-wall enforcement is enabled. The parent client is kept.
Deleting a matter does not delete historical queries associated with that matter, nor does it remove the matter from those historical queries.
curl --request DELETE \
--url https://api.harvey.ai/api/v2/matters \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"matters": [
{
"client_id": "10022421",
"matter_id": "M001"
},
{
"client_id": "10022421",
"matter_id": "M002"
}
]
}
'import requests
url = "https://api.harvey.ai/api/v2/matters"
payload = { "matters": [
{
"client_id": "10022421",
"matter_id": "M001"
},
{
"client_id": "10022421",
"matter_id": "M002"
}
] }
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({
matters: [
{client_id: '10022421', matter_id: 'M001'},
{client_id: '10022421', matter_id: 'M002'}
]
})
};
fetch('https://api.harvey.ai/api/v2/matters', 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/matters",
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([
'matters' => [
[
'client_id' => '10022421',
'matter_id' => 'M001'
],
[
'client_id' => '10022421',
'matter_id' => 'M002'
]
]
]),
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/matters"
payload := strings.NewReader("{\n \"matters\": [\n {\n \"client_id\": \"10022421\",\n \"matter_id\": \"M001\"\n },\n {\n \"client_id\": \"10022421\",\n \"matter_id\": \"M002\"\n }\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/matters")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"matters\": [\n {\n \"client_id\": \"10022421\",\n \"matter_id\": \"M001\"\n },\n {\n \"client_id\": \"10022421\",\n \"matter_id\": \"M002\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.harvey.ai/api/v2/matters")
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 \"matters\": [\n {\n \"client_id\": \"10022421\",\n \"matter_id\": \"M001\"\n },\n {\n \"client_id\": \"10022421\",\n \"matter_id\": \"M002\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"deleted": [
{
"client_id": "10022421",
"matter_id": "M001"
}
],
"already_absent": [],
"errors": []
}Permissions
Requires Client matters admin (write:client_matters).
Matching
Send theclient_id and matter_id you use with POST /api/v2/matters. Do not send the full matter name or harvey_id. Harvey trims leading and trailing whitespace from both identifiers. Matching uses the identifier pair first, then the stored name: client_id + the delimiter + matter_id. This finds matters created through v1. Deleted matters also match. The API uses the delimiter configured for the token’s active workspace, or . when it is unset or blank. This endpoint never returns delimiter_required, and the workspace’s name format does not apply.
Results
Each pair appears once in the response: indeleted, already_absent, or errors. deleted and already_absent return the trimmed identifiers. errors echoes the values you sent. A pair with no matching matter, including a pair whose client does not exist, appears in already_absent. So does a matter that was already deleted. These are successful results, so a repeated request is safe. A pair that repeats an earlier pair after trimming fails with duplicate_pair; Harvey processes the earlier pair as usual.
Externally linked matters, such as matters synced from a DMS or an ethical-wall provider, fail with blocked_by_ethical_wall while ethical-wall enforcement is enabled for the workspace.
Deleting a matter keeps its parent client and its ethical-wall configuration. A later POST /api/v2/matters with the same pair restores the matter.
See the Client Matters guide for examples and error handling.Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
Submit explicit client_id and matter_id pairs. Unknown fields return HTTP 400 with invalid_request.
1 - 10000 elementsShow child attributes
Show child attributes