Update a document
In the Esign Comply API, PATCH /v1/documents/{id} changes a document's name or metadata, or archives or restores it, and returns the updated document. Use it to rename or archive a document, which leaves every published version unchanged. It takes a secret key with full_access or recording_access permission.
PATCH /v1/documents/{id} · API version 2026-11-21
Authentication
Send a secret key in the Authorization header: Bearer $ESIGNCOMPLY_API_KEY. The key needs full_access or recording_access permission. Test keys and live keys both work, and each reads and writes the objects of its own environment. Call it from your server: a secret key never goes to a browser. Keys and permissions are described under Authentication.
Request example
cURL
curl -X PATCH https://esigncomply.com/v1/documents/doc_8Hq2 \
-H "Authorization: Bearer $ESIGNCOMPLY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"metadata": {
"owner": "legal"
}
}'
This request ran against the API on November 26, 2026, and the response below is what came back. IDs are example values, and long values are shortened with ....
What it does
Changes metadata only. Published versions are never changed by this call.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id |
path | string | Yes | ID of the document. |
Body fields
| Field | Type | Required | Description |
|---|---|---|---|
name |
string, 1 to 200 characters | No | New title. Existing records keep the title that was sealed in them. |
metadata |
object | No | Replaces the stored metadata. |
archived |
boolean | No | true archives the document, false restores it. |
Headers: Esign-Comply-Version (optional, a dated API version). See API conventions.
Response
200 OK with a Document object.
{
"object": "document",
"id": "doc_8Hq2",
"livemode": false,
"name": "Terms of Service",
"type": "terms",
"metadata": {
"owner": "legal"
},
"archived": false,
"created_at": "2026-11-26T00:15:40.359Z"
}
Response fields
| Field | Type | Description |
|---|---|---|
object |
string | |
id |
string | |
livemode |
boolean | |
name |
string | |
type |
string | |
metadata |
object | |
archived |
boolean | |
created_at |
datetime | |
current_version |
string | |
warnings |
array of string |
Errors
| Code | HTTP | When |
|---|---|---|
invalid_request |
400 | The request is malformed: the body is not valid JSON, a known field has the wrong type, a required field is missing, a value is out of range, or a limit was passed (for example metadata over 50 keys, context.extra over 16 KB, event data over 256 KB, an Idempotency-Key over 255 characters, an unknown Esign-Comply-Version). |
not_found |
404 | No object with that ID exists in this domain and environment. |
Like every call made with a secret key, it can also return missing_api_key, invalid_api_key, domain_not_verified, insufficient_permission, region_mismatch, rate_limit_exceeded and internal_error.
Every error has the same body: error.type, error.code, error.message, error.doc_url and error.request_id. See Errors.
Questions about PATCH /v1/documents/{id}
Which credential does PATCH /v1/documents/{id} need?
A secret key with full_access or recording_access permission. Send it as a Bearer token in the Authorization header, from your server only. A session client token is refused with insufficient_permission.
Does PATCH /v1/documents/{id} work with a test key?
Yes. It works with test keys and live keys. A test key reads and writes test objects only, and a live key works once the domain is verified.
Does PATCH /v1/documents/{id} count as a signature event?
No. A signature event is counted when a live record is written, by completing a session or by submitting a deferred acceptance. This call writes no record.
Is PATCH /v1/documents/{id} idempotent?
It takes no Idempotency-Key header. The API acts on that header for POST calls only, and this is a PATCH.
What is the rate limit for PATCH /v1/documents/{id}?
The limit is counted for each key and depends on the plan: 2 requests per second on Free, 10 on Starter, 50 on Unlimited and 100 on Enterprise. Past the limit the API answers 429 rate_limit_exceeded with a Retry-After header.
Does the Node SDK have a method for PATCH /v1/documents/{id}?
No. Call it over HTTP, or with esc.request() in the esigncomply package, which sends the key and returns { data, error }.
Related
- Documents: the overview of the resource and all of its operations.
- Publish a document version:
POST /v1/documents/{id}/versions - List document versions:
GET /v1/documents/{id}/versions - Retrieve a document version:
GET /v1/documents/{id}/versions/{version_id} - Fetch document version content:
GET /v1/documents/{id}/versions/{version_id}/content - Re-acceptance of a new version
- Errors: every error code, with what to do.
- API conventions: authentication, idempotency, rate limits and versioning.
Last updated · API version 2026-11-21