PATCH /api/v1/documents/{id} · Operation ID: updateDocumentdocuments:write. Resource access and effective policy still apply.curl --fail-with-body -X PATCH 'https://handwrites.io/api/v1/documents/REPLACE_DOCUMENT_ID' \
-H "Authorization: Bearer $HANDWRITE_API_KEY" \
-H 'If-Match: "REPLACE_REVISION"' \
-H 'Content-Type: application/json' \
--data '{"title":"Field notes, week 2"}'| Name | Location | Required | Meaning |
|---|---|---|---|
id | path | Yes | A document ID (doc_…). |
If-Match | header | No | The revision you last saw, like "3"; 412 if the document has moved on. |
application/json (required). Send at least one field.| Field | Required | Meaning |
|---|---|---|
title | No | string |
content | No | Up to 4 MB. |
contentType | No | See API schema |
language | No | See schema alternatives |
| Status | Meaning | Body format |
|---|---|---|
| 200 | The new revision. | application/json |
| 400 | invalid_request (the message names the field), validation_failed. | application/json |
| 401 | unauthorized: no token, or it's invalid, revoked or expired. | application/json |
| 403 | insufficient_scope, forbidden (you can see it but not do this), app_test_restricted, account_deleted (the account is scheduled for deletion; any request). | application/json |
| 404 | not_found: it doesn't exist or you can't see it (never 403 for documents you can't see). | application/json |
| 409 | conflict (changed meanwhile, already a member) or idempotency_in_progress (with Retry-After). | application/json |
| 412 | revision_mismatch: If-Match didn't match; ETag has the current revision. | application/json |
| 413 | too_large (text over 4 MB) or too_long (audio over its limit). | application/json |
| 429 | rate_limited (burst or daily cap) or quota_exceeded (no characters left). | application/json |
| 500 | internal_error. | application/json |