Skip to main content
PATCH /v1/documents/:id lets you update the metadata of a document you own. All body fields are optional; you only need to include the fields you want to change. Successfully updating a document triggers a document.updated event in your activity feed.
This endpoint updates document metadata only. To attach or modify the associated loan, use the create endpoint with a new document, or contact support for loan record changes.
PATCH /v1/documents/:id

Request headers

Authorization
string
required
Bearer token obtained from your Clerk session. Example: Bearer eyJhbGc...
Content-Type
string
required
Must be application/json.

Path parameters

id
string
required
The unique identifier of the document to update. The document must be owned by your account; the API returns 404 for documents that do not exist or belong to another account.

Request body

All fields are optional. The API only modifies the fields you include in the request body.
title
string
New display name for the document. Minimum 1 character, maximum 200 characters.
description
string or null
New description. Maximum 2000 characters. Pass null explicitly to clear an existing description.
chattelType
string
New chattel type classification ID. Must be one of the valid chattel type IDs. Returns 400 if the value is not recognized.

Response

Returns 200 OK with the updated document.
document
object
required
The full updated document object.

Example

curl --request PATCH \
  --url https://your-api.example.com/v1/documents/doc_01j9z8x7w6v5u4t3s2r1q0p \
  --header 'Authorization: Bearer <your-session-token>' \
  --header 'Content-Type: application/json' \
  --data '{
    "title": "2022 Ford F-150 — Revised Loan Package"
  }'

Error cases

StatusError messageCause
400Invalid body.A field value fails schema validation, for example title exceeds 200 characters.
400Invalid chattelType.The chattelType value is not a recognized chattel type ID.
401Missing Authorization Bearer token.No Authorization header was sent.
401Invalid or expired token.The Bearer token is malformed or has expired.
404Not found.No document with the given id exists, or it belongs to a different account.