Erase a person's data
Start, confirm, cancel and read a GDPR erasure request, and know what the job keeps.
Developers and superusers who handle a request from a person to be erased, or a guardian's request for a child.
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.
| Who | How | Needs |
|---|---|---|
| A signed-in person, for their own account | POST /api/me/erasure | A fresh passkey, or the password if the account has none. Then the emailed confirmation. |
| A guardian, for a child without a login | POST /api/me/erasure with {"member": "<id>"} | The same. The guardian is emailed. |
| A superuser | POST /api/gdpr/subjects/{id}/erase | A 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
- 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. - Grace. After confirmation the state is
grace. The default is 14 days. The settingerasure.graceDaystakes 0 to 30. The account is locked with apending_erasureban. The person is emailed the date and a cancel link. - 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, orPOST /api/gdpr/erasures/{id}/cancel. Cancelling lifts the lock and erases nothing. - The job. The job runs the data map, one request at a time. It continues after a restart. The state ends
done,partialorfailed. - Result. The person is emailed counts, what was kept and why. The email goes out before the address is anonymized.
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
| Data | Treatment |
|---|---|
| The account | Anonymized. The row stays, and a permanent erased ban stops sign-in. |
| Sessions, passkeys, API keys, OAuth tokens | Erased. |
| Memberships and invitations | Erased. Memberships from SCIM are suspended first. |
| The household member row | Anonymized, never deleted. |
| Consent evidence and break-glass rows | Kept, with the person replaced by a pseudonym. |
| Pastoral notes about the person | Kept for their author, unlinked from the person. Notes the person wrote are not erased with them. |
| The audit log | Scrubbed: before, after and IP are emptied. Action, time and names stay. |
| Permanent register entries | Retained. See below. |
| Rows under a legal hold | Skipped 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
POST /api/gdpr/subjects/{id}/erase, fresh passkey.- The person confirms the emailed link.
- Wait out the grace period.
Stop one
POST /api/gdpr/erasures/{id}/cancelbefore 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.