Skip to main content

Erase a person's data

DEVELOPER GUIDE

Start, confirm, cancel and read a GDPR erasure request, and know what the job keeps.

Who this guide is for

Developers and superusers who handle a request from a person to be erased, or a guardian's request for a child.

Why it matters

Erasure is destructive and cannot be undone. It has an emailed confirmation, a grace period, legal holds and an erasure log to protect against mistakes.

What you will do, in one sentence

Start the request, let the person confirm by email, wait out the grace period, and read the result.

Screens are captured from a seeded test system. Every name, address and number on the screens is invented. Prepared 15 November 2026.

1. Who can ask​

Erasure is destructive and cannot be undone. Whether a record may be kept against a request is a question for your lawyer.

WhoHowNeeds
A signed-in person, for their own accountPOST /api/me/erasureA fresh passkey, or the password if the account has none. Then the emailed confirmation.
A guardian, for a child without a loginPOST /api/me/erasure with {"member": "<id>"}The same. The guardian is emailed.
A superuserPOST /api/gdpr/subjects/{id}/eraseA fresh passkey. Either a recorded identity check or the person's emailed confirmation.

A child cannot ask for themselves. A guardian cannot ask for another adult. A superuser account cannot be erased with this tool. API keys are refused.

For a person with no usable email, a superuser records how they checked identity:

curl -X POST https://auth.example.org/api/gdpr/subjects/USER_ID/erase \
-H "Authorization: $TOKEN" -H "Content-Type: application/json" \
-d '{"identityCheck": "Photo identity seen at the office, 2026-11-14"}'

Add "requireConfirmation": true to email the person the link instead.

2. What happens​

  1. Request. The state is awaiting_confirmation. The person gets a link valid for 7 days. A page with a button opens. Only the button confirms, so a mail scanner changes nothing.
  2. Grace. After confirmation the state is grace. The default is 14 days. The setting erasure.graceDays takes 0 to 30. The account is locked with a pending_erasure ban. The person is emailed the date and a cancel link.
  3. Cancel. Until the job starts, the request can be cancelled. Use the cancel link, a passkey sign-in of the locked account, POST /api/me/erasure/{id}/cancel, or POST /api/gdpr/erasures/{id}/cancel. Cancelling lifts the lock and erases nothing.
  4. The job. The job runs the data map, one request at a time. It continues after a restart. The state ends done, partial or failed.
  5. Result. The person is emailed counts, what was kept and why. The email goes out before the address is anonymized.
After the grace period there is no undo

Once the job runs, the account is anonymized and its other rows are erased. Backups and replicas are not rewritten. Erased data stays in them until they rotate. Set backup retention against your policy.

3. What each collection gets​

DataTreatment
The accountAnonymized. The row stays, and a permanent erased ban stops sign-in.
Sessions, passkeys, API keys, OAuth tokensErased.
Memberships and invitationsErased. Memberships from SCIM are suspended first.
The household member rowAnonymized, never deleted.
Consent evidence and break-glass rowsKept, with the person replaced by a pseudonym.
Pastoral notes about the personKept for their author, unlinked from the person. Notes the person wrote are not erased with them.
The audit logScrubbed: before, after and IP are emptied. Action, time and names stay.
Permanent register entriesRetained. See below.
Rows under a legal holdSkipped and listed as legal_hold.

The job reads the data map. A collection that holds personal data and is not on the map is not reached.

Each final register entry gets a data_subject_note annotation and restricted = true. The request ends partial with the reason. A draft entry is kept and listed for a registrar to decide.

4. Refusals​

Two cases are refused before anything changes. Each returns 409 with a code in data.code.

  • last_guardian: the person is the only active adult guardian of a household with a minor. Add another guardian first.
  • last_owner: the person is the only owner of an organization. Make someone else an owner, or archive the organization.

The job checks again when it starts. A refusal at run time ends the request failed, unlocks the account and emails the person.

5. Read and restore​

GET /api/gdpr/erasures[?subject=&state=]
GET /api/gdpr/erasures/{id}
GET /api/me/erasure

The audit actions are gdpr_erase_request, gdpr_erase_confirm, gdpr_erase_cancel and gdpr_erase. The webhook gdpr.erase carries ids and counts only.

Pseudonyms are an HMAC under a per-install secret stored in the database. Do not delete it. Without it, old pseudonyms cannot be matched.

The _erasureLog keeps a keyed hash for each erased person. After a restore of an older backup, the server finds people who came back and erases them again. Check GET /api/gdpr/erasures?state=queued and the server log after every restore.

6. Quick reference card​

Start an erasure​

  1. POST /api/gdpr/subjects/{id}/erase, fresh passkey.
  2. The person confirms the emailed link.
  3. Wait out the grace period.

Stop one​

  1. POST /api/gdpr/erasures/{id}/cancel before the job starts.

Questions for a lawyer: which audit entries may be kept for security. Whether a church register may be kept. How long consent evidence may be kept. The wording of the result email.