> ## Documentation Index
> Fetch the complete documentation index at: https://docs.heretic.tech/llms.txt
> Use this file to discover all available pages before exploring further.

# Erase ceremony data

> Delete ceremonies and passkey records using a backend secret key.

Call these endpoints from your backend with `Authorization: Bearer hrtc_sk_…`. The secret key limits each operation to your workspace.

## Create an erasure

`POST https://heretic.tech/v1/erasures`

Send exactly one selector: `account_ref` or `challenge_id`.

```bash theme={"dark"}
curl https://heretic.tech/v1/erasures \
  -H "Authorization: Bearer $HERETIC_SECRET_KEY" \
  -H 'Content-Type: application/json' \
  --data '{"account_ref":"acct_123"}'
```

An account erasure removes the ceremonies and credentials associated with that exact account reference, through the request time. A challenge erasure removes that ceremony and its newly created anonymous credential. It does not revoke a named-account credential shared with other ceremonies.

```json theme={"dark"}
{
  "challenge_id": "chg_0123456789abcdef0123456789abcdef"
}
```

The response is `202`:

```json theme={"dark"}
{
  "erasure_id": "er_12345678-1234-1234-1234-123456789abc",
  "scope": "account",
  "deleted": { "challenges": 2, "credentials": 1 },
  "physical_deletion": "pending"
}
```

A selector with no matching records returns zero counts. Keep the erasure ID to check submission progress.

## Read the receipt

`GET https://heretic.tech/v1/erasures/{erasure_id}`

```bash theme={"dark"}
curl "https://heretic.tech/v1/erasures/$ERASURE_ID" \
  -H "Authorization: Bearer $HERETIC_SECRET_KEY"
```

The receipt has the same fields. `physical_deletion` changes from `pending` to `submitted` when the storage service accepts the deletion requests. Failed submissions are retried. `submitted` does not certify destruction of every physical copy or customer export.

## Scope and retention

Ceremony history is available for seven days from creation. Passkey credentials remain until explicitly erased because later account-exclusion checks can use them. Erasure receipts are kept for one year, or longer while a deletion remains pending.

These selectors include the selected ceremonies' measurement records. They do not erase an original customer-page probe or your Heretic billing account. Erase probe history through the site's data controls in [the dashboard](/dashboard/dashboard-and-keys). Site erasure also removes its widget ceremonies and associated anonymous credentials; named-account credentials shared across your workspace remain.

## Status codes

| Status | Meaning                                                                               |
| ------ | ------------------------------------------------------------------------------------- |
| `202`  | Erasure recorded.                                                                     |
| `200`  | Receipt returned.                                                                     |
| `400`  | Missing, malformed, ambiguous or unsupported selector.                                |
| `401`  | Missing or invalid secret key.                                                        |
| `404`  | Receipt not found in your workspace.                                                  |
| `429`  | Rate limit reached; respect `Retry-After`.                                            |
| `503`  | Temporary service or storage failure. Retry without treating the erasure as complete. |


## Related topics

- [Challenge widget](/integration/challenge-widget.md)
- [Siteverify endpoint](/api/siteverify-endpoint.md)
- [Signup rules](/integration/writing-rules.md)
- [Privacy and retention](/data/privacy-and-retention.md)
- [Read the outcome](/api/challenge-read.md)
