# Start an erasure or restriction

> 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.

Source: https://esigncomply.com/docs/api/signers/start-an-erasure-or-restriction

Last updated November 26, 2026

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](https://esigncomply.com/docs/api.md#authentication).

## Request example

### cURL

```bash
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

```ts
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`](https://esigncomply.com/docs/api/errors.md#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](https://esigncomply.com/docs/api.md).

## Response

`201 Created` with an ErasureRequest object.

```json
{
  "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`](https://esigncomply.com/docs/api/errors.md#invalid_request) | 400 | For an unknown `scope`. |
| [`not_found`](https://esigncomply.com/docs/api/errors.md#not_found) | 404 | When no signer has this external ID. |
| [`insufficient_permission`](https://esigncomply.com/docs/api/errors.md#insufficient_permission) | 403 | For keys without `full_access`. |

Like every call made with a secret key, it can also return [`missing_api_key`](https://esigncomply.com/docs/api/errors.md#missing_api_key), [`invalid_api_key`](https://esigncomply.com/docs/api/errors.md#invalid_api_key), [`domain_not_verified`](https://esigncomply.com/docs/api/errors.md#domain_not_verified), [`idempotency_conflict`](https://esigncomply.com/docs/api/errors.md#idempotency_conflict), [`region_mismatch`](https://esigncomply.com/docs/api/errors.md#region_mismatch), [`rate_limit_exceeded`](https://esigncomply.com/docs/api/errors.md#rate_limit_exceeded) and [`internal_error`](https://esigncomply.com/docs/api/errors.md#internal_error).

Every error has the same body: `error.type`, `error.code`, `error.message`, `error.doc_url` and `error.request_id`. See [Errors](https://esigncomply.com/docs/api/errors.md).

## 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.

## Related

- [Signers](https://esigncomply.com/docs/api/signers.md): the overview of the resource and all of its operations.
- [List a signer's records](https://esigncomply.com/docs/api/signers/list-a-signers-records.md): `GET /v1/signers/{external_id}/records`
- [Retrieve signer status](https://esigncomply.com/docs/api/signers/retrieve-signer-status.md): `GET /v1/signers/{external_id}/status`
- [Withdraw consent to electronic records](https://esigncomply.com/docs/api/signers/withdraw-consent-to-electronic-records.md): `POST /v1/signers/{external_id}/consents/withdraw`
- [Re-acceptance of a new version](https://esigncomply.com/docs/guides/reacceptance.md)
- [Errors](https://esigncomply.com/docs/api/errors.md): every error code, with what to do.
- [API conventions](https://esigncomply.com/docs/api.md): authentication, idempotency, rate limits and versioning.
