Withdraw consent to electronic records
In the Esign Comply API, POST /v1/signers/{external_id}/consents/withdraw records that a signer withdrew consent to electronic records by adding a consent_withdrawn annotation to one of their records. Call it when a withdrawal reaches you through your own channels, such as support or account settings.
POST /v1/signers/{external_id}/consents/withdraw · API version 2026-11-21
Authentication
Send a secret key in the Authorization header: Bearer $ESIGNCOMPLY_API_KEY. The key needs full_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 https://esigncomply.com/v1/signers/user_7c1d/consents/withdraw \
-H "Authorization: Bearer $ESIGNCOMPLY_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: withdraw-user_7c1d-2027-01-04" \
-d '{
"note": "Requested by phone on 2027-01-04. Ticket 55120."
}'
Node SDK
import { EsignComply } from "esigncomply";
const esc = new EsignComply(process.env.ESIGNCOMPLY_API_KEY);
const { data, error } = await esc.signers.withdrawConsent(
"user_7c1d",
{ note: "Requested by phone on 2027-01-04. Ticket 55120." },
{ idempotencyKey: "withdraw-user_7c1d-2027-01-04" },
);
The two samples send the same Idempotency-Key with bodies that differ in whitespace. Run one of them, or change the key: the same key with different bytes in the body answers 409 idempotency_conflict.
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
Records that a consumer withdrew consent to receive records electronically. Call it when the withdrawal reaches you through your own channels, such as support or account settings. Signers can also withdraw themselves from the link in every receipt.
Esign Comply adds a consent_withdrawn annotation to a record of that signer, timestamps it, and sends the consent.withdrawn webhook. Withdrawal is prospective only: earlier records remain. What you do after a withdrawal, such as switching the person to paper delivery, is your responsibility. See the consumer consent guide.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
external_id |
path | string | Yes | Your own ID for the signer: the signer.external_id of its sessions. |
Body fields
| Field | Type | Required | Description |
|---|---|---|---|
record_id |
string | No | The record to attach the withdrawal to. It must belong to this signer. Default: the signer's latest record in which electronic-records consent was given, otherwise the latest record. |
scope |
string, up to 64 characters | No | What the withdrawal covers. Default electronic_records. |
note |
string, up to 2,000 characters | No | Free text, for example how the request arrived. |
Headers: Idempotency-Key (optional, up to 255 characters) and Esign-Comply-Version (optional, a dated API version). See API conventions.
Response
201 Created with a ConsentWithdrawal object.
{
"object": "consent_withdrawal",
"signer": "user_7c1d",
"record_id": "rec_Z4m8",
"annotation_id": "ann_Jir0",
"recorded_at": "2026-11-26T00:17:38.337Z"
}
Response fields
| Field | Type | Description |
|---|---|---|
object |
string | |
signer |
string | The signer's external ID. |
record_id |
string | |
annotation_id |
string | |
recorded_at |
datetime |
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 session has named this external ID in this domain and environment, so there is no such signer. Also when record_id is not one of the signer's records. |
subject_not_found |
404 | The signer exists, because a session named them, and has no completed record yet: there is nothing to attach the withdrawal to. |
insufficient_permission |
403 | The key does not have full_access. |
Like every call made with a secret key, it can also return missing_api_key, invalid_api_key, domain_not_verified, idempotency_conflict, 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 POST /v1/signers/{external_id}/consents/withdraw
Which credential does POST /v1/signers/{external_id}/consents/withdraw need?
A secret key with full_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 POST /v1/signers/{external_id}/consents/withdraw 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 POST /v1/signers/{external_id}/consents/withdraw 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 POST /v1/signers/{external_id}/consents/withdraw idempotent?
Yes, with an Idempotency-Key header of up to 255 characters. A repeat with the same key and the same bytes in the body returns the original response, with the header Idempotent-Replayed: true. The same key with a different body answers 409 idempotency_conflict.
What is the rate limit for POST /v1/signers/{external_id}/consents/withdraw?
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 POST /v1/signers/{external_id}/consents/withdraw?
Yes: esc.signers.withdrawConsent() in the esigncomply package. It resolves to { data, error } and does not throw.
Related
- Signers: the overview of the resource and all of its operations.
- Start an erasure or restriction:
POST /v1/signers/{external_id}/erasure-requests - List a signer's records:
GET /v1/signers/{external_id}/records - Retrieve signer status:
GET /v1/signers/{external_id}/status - 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