Skip to content
DocsMenu

Start an erasure or restriction

View as Markdown

Open this page inChatGPTClaudeCursor

In the Esign Comply API, POST /v1/signers/{external_id}/erasure-requests processes a request to erase or restrict a signer's data in the same call and reports the outcome. Call it after you, as controller, have decided to erase or restrict, because an erasure cannot be undone.

POST /v1/signers/{external_id}/erasure-requests · 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_2f9k/erasure-requests \
  -H "Authorization: Bearer $ESIGNCOMPLY_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: erasure-user_2f9k-dsr-2027-018" \
  -d '{
    "scope": "erasure",
    "basis": "Data-subject request DSR-2027-018."
  }'

Node SDK

import { EsignComply } from "esigncomply";

const esc = new EsignComply(process.env.ESIGNCOMPLY_API_KEY);

const { data, error } = await esc.signers.requestErasure(
  "user_2f9k",
  { scope: "erasure", basis: "Data-subject request DSR-2027-018." },
  { idempotencyKey: "erasure-user_2f9k-dsr-2027-018" },
);

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

Use it when you, as the controller of the signer's data, have decided to erase or restrict it, for example after a data-subject request. The request is processed in the same call and the response reports the outcome.

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
scope erasure or restriction No Default erasure.
basis string, up to 500 characters No Your reason or reference, stored with the request.
status Meaning
completed Done. An erasure carries erased: true. A restriction carries restricted: true: the signer is marked as restricted and the request is logged, and nothing is removed.
blocked_by_hold Nothing was erased. reason says why: a legal hold applies to at least one of the signer's records, or a retention floor recorded on a record has not expired. Release the hold with a legal_hold_released annotation, or wait for the floor to pass, then ask again.
rejected The request could not be carried out. reason gives the cause.

Headers: Idempotency-Key (optional, up to 255 characters) and Esign-Comply-Version (optional, a dated API version). See API conventions.

Response

201 Created with an ErasureRequest object.

{
  "object": "erasure_request",
  "id": "ers_PswG",
  "signer": "user_2f9k",
  "scope": "erasure",
  "status": "completed",
  "erased": true,
  "note": "The signer's data key was destroyed. Record hashes, seals and ledger entries remain."
}

Response fields

Field Type Description
object string
id string
signer string The signer's external ID.
scope string
status string

What erasure removes

Erasure destroys the signer's data key, so every field encrypted under it becomes unrecoverable:

  • the signer's identity facts (name, email, phone, passkeys);
  • the content of the signer's records, with their salts, and the data of their ceremony events, including IP addresses and user agents;
  • session context and metadata, annotation data, and the text and data of supplements attached to the signer or the signer's records;
  • the content of single-record certificates issued for those records, and the signer's receipt links.

What erasure leaves behind

  • The record hash, the signed receipt and the ledger entries. These are hashes and positions, with no readable signer content.
  • An erased entry in the ledger for each record, so the erasure itself is evidenced.
  • The record IDs. Each record's status becomes voided: GET /v1/records/{id} then returns 404, and the records leave list results unless you filter by status=voided.

Evidence packages you exported earlier are your copies and are not changed by this call. If the same external ID signs again later, the new record is encrypted under a new key. Earlier content stays unrecoverable.

Erasure cannot be undone. Export what you are required to keep before you call it.

Errors

Code HTTP When
invalid_request 400 For an unknown scope.
not_found 404 When no signer has this external ID.
insufficient_permission 403 For keys without 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}/erasure-requests

Which credential does POST /v1/signers/{external_id}/erasure-requests 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}/erasure-requests 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}/erasure-requests 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}/erasure-requests 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}/erasure-requests?

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}/erasure-requests?

Yes: esc.signers.requestErasure() in the esigncomply package. It resolves to { data, error } and does not throw.

Last updated · API version 2026-11-21