Skip to main content
Use the Client Matters API to sync your firm’s client and matter identifiers with Harvey. Create clients first, then create, update, or delete their matters. To delete a client, delete its matters first. Use the v1 endpoint to list matters.
These endpoints share a rate limit that defaults to 150 requests per minute per workspace. Each v2 request accepts 1 to 10,000 rows. Always check the errors array in the v2 response, even when the request returns HTTP 200.

Before you start

Use an API bearer token with Client matters admin (write:client_matters) to create, update, or delete records. To list matters, either this permission or Access client matters (read:client_matters) is sufficient. If your workspace has matters previously created using full names, you must explicitly set the workspace delimiter before using the v2 APIs. Set it to the separator used in those names. For an existing name such as 10022421-M001, set the delimiter to - and send client_id: "10022421" and matter_id: "M001". Harvey joins client_id, the workspace delimiter, and matter_id to form a full matter name. The examples below use .: client 10022421 and matter M001 form 10022421.M001. The v1 list API returns this full name as name, and the v1 delete API accepts it. The optional client_name and matter_name fields are display labels, such as Acme Corp and Acme Acquisition.

Create or update a client

A new client appears in created:
To update a client, send its client_id again with the fields you want to change. The response includes the client in updated, even if the values are unchanged. If the client was deleted, the request restores it. Restoring a client does not restore its deleted matters; restore those through POST /api/v2/matters.

Create or update a matter

Create or restore the client before sending its matters. This endpoint does not create missing clients.
To update a matter, send the same client_id and matter_id with the fields you want to change. Harvey first looks for that pair of identifiers. If it finds no match, it checks for a matter with the same full name, such as 10022421.M001. This lets the request update a matter created through v1. The matched matter appears in updated and keeps its harvey_id. If it was deleted, the request restores it. harvey_id is the matter’s ID in Harvey.

Update or clear fields

For a new record, these fields default to null when omitted. client_id must contain 1 to 128 characters, and matter_id must not be empty. The full matter name (client_id + delimiter + matter_id, such as 10022421.M001) must contain at most 128 characters and match the format configured for the workspace, if any. For example, this request clears the notice and keeps the matter’s other fields:
allowed follows separate rules:
  • Omit it to preserve an existing value. New matters default to true.
  • Sending it requires use:disallowed_client_matters, even when setting it to true. Without that permission, the whole request returns HTTP 403.
  • Use a JSON boolean (true or false), not a string. With the required permission, null returns HTTP 400 with invalid_request.

Handle batch results and errors

Each HTTP 200 response from POST /api/v2/clients or POST /api/v2/matters has three arrays: created, updated, and errors. An error in one row does not block valid rows in the same request. For example, a batch can update one matter while rejecting another whose client does not exist:
Use error codes to handle failures in your integration. The detail field explains the error in plain language. Correct failed rows before retrying them. Errors that affect the whole request use these HTTP status codes: POST /api/v2/matters uses the delimiter from the API token’s active workspace. If it is unset or empty, the endpoint uses . unless the workspace requires an explicit delimiter. When an explicit delimiter is required but missing, the endpoint returns HTTP 400:
Harvey does not create or update any matters in this batch. Set the workspace delimiter and retry. POST /api/v2/clients does not return this error.

Delete matters

Send the same client_id and matter_id pairs that you use with POST /api/v2/matters. Do not send the full matter name, the matter label, or harvey_id.
Each pair appears once in the response, in deleted, already_absent, or errors. In this example, the request deletes M001, and M002 does not exist:
  • deleted: the request deleted the matter.
  • already_absent: no matter matches the pair, or the matter was already deleted. This is a successful result, so you can safely repeat a request. A pair whose client does not exist also appears here.
  • errors: the request did not delete the matter. An error in one pair does not block the other pairs in the request.
deleted and already_absent return the identifiers without leading and trailing whitespace. Each entry in errors echoes the values you sent. Harvey first looks for the pair of identifiers. If it finds no match, it checks for a matter with the same full name, such as 10022421.M001. This lets the request delete a matter created through v1. The endpoint uses the delimiter from the API token’s active workspace, or . if the delimiter is unset or blank. It never returns delimiter_required, and the workspace’s name format does not apply to deletes. A request with more than 10,000 pairs returns HTTP 400 with too_many_items. An empty batch, a missing field, a wrong type, or an unknown field returns HTTP 400 with invalid_request. In both cases, Harvey deletes no matters. Deleting a matter prevents users from selecting it. It does not remove past queries or their links to the matter. Harvey keeps the parent client and the matter’s ethical-wall configuration. A later request to POST /api/v2/matters with the same pair restores the matter. To delete the client after its matters, see Delete clients.

Delete clients

Delete a client’s matters with DELETE /api/v2/matters before you delete the client. This endpoint does not delete or change matters. A client that still has a matter fails with client_has_matters. Send the client_id values that you use with POST /api/v2/clients. Do not send the client label (client_name) or the Harvey client UUID.
Each identifier appears once in the response, in deleted, already_absent, or errors. In this example, the request deletes 10022421, and 10022422 does not exist:
  • deleted: the request deleted the client.
  • already_absent: no client matches the identifier, or the client was already deleted. This is a successful result, so you can safely repeat a request.
  • errors: the request did not delete the client. An error for one identifier does not block the other identifiers in the request.
Within each array, results keep the order of the request. deleted and already_absent return the identifiers without leading and trailing whitespace. Each entry in errors echoes the value you sent. For example, this response deletes one client and rejects a client that still has a matter:
A request with more than 10,000 client IDs returns HTTP 400 with too_many_items. An empty list, a missing field, a wrong type, or an unknown field returns HTTP 400 with invalid_request. In both cases, Harvey deletes no clients. A later request to POST /api/v2/clients with the same client_id restores the client. Restoring a client does not restore its deleted matters. Restore those through POST /api/v2/matters.

List matters

GET /api/v1/client_matters is the only endpoint that lists matters. The list includes deleted matters and usage statistics:
The response contains a client_matters array. Each row uses these identifiers: The v2 endpoints expect your firm’s client identifier in client_id. Do not pass the Harvey client UUID returned by this list endpoint.

Migrate from v1 writes

POST /api/v1/client_matters is deprecated. To migrate to v2:
  1. Explicitly set the workspace delimiter to match your existing full matter names. For example, for cm_name: "10022421-M001", configure - and use client_id: "10022421" with matter_id: "M001". Joining these identifiers with the delimiter must reproduce the existing name so Harvey can match the matter.
  2. Create or update each client with POST /api/v2/clients.
  3. Create or update its matters with POST /api/v2/matters. Map cm_desc to description. If you send cm_allowed, map it to the JSON boolean allowed and ensure the token has use:disallowed_client_matters permission.
  4. Handle created, updated, and errors instead of v1’s success_count and failed.
DELETE /api/v1/client_matters still deletes matters by full name. To delete by identifiers, send client_id and matter_id pairs to DELETE /api/v2/matters. Handle deleted, already_absent, and errors instead of success_count and failed. To delete clients, send their client_id values to DELETE /api/v2/clients after you delete their matters. client_name and matter_name are optional labels; they do not replace the identifiers. notice is available through the v2 matter endpoint. Continue using GET /api/v1/client_matters to list matters.