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

# Erasure

> Track the data your apps must erase when a person's consent for a purpose ends, and mark it done.

Under the DPDP Act, 2023 (Section 8(7)), when consent is withdrawn or a purpose is no longer served, the data used for it must be erased, unless a law requires keeping it. Your processors must erase it too.

Aiveth by Gooclaim doesn't hold your app's data, so it can't erase it for you. Instead, it opens an **erasure task** each time a yes ends, tells your apps, tracks the deadline, and keeps a record of how each task was closed.

> [!NOTE]
>
> This page describes what Aiveth does. It is not legal advice.

## When a task opens

Aiveth opens one task for a person and a purpose when their yes ends:

* they withdraw it on their account page
* your app withdraws it through the admin API
* a parent withdraws it for a child
* a Consent Manager sends a withdrawal
* a time-bound yes expires

Each task has a reason (`withdrawn` or `expired`) and a due date. If the person says yes again before the task is done, it is cancelled. Imported answers never open a task.

## Set the deadline

In the console, go to **Privacy** → **Data to erase**. Under **Apps must erase within**, choose 7, 15 or 30 days. The default is 30. You need a role that can manage people.

## The `erasure.requested` webhook

When a task opens, your apps get an `erasure.requested` [webhook](https://docs.aiveth.com/events/webhooks.md). Its data says whose data to erase, for which purpose, and by when:

```json theme={null}
{
  "object": "erasure",
  "id": "4b1e...",
  "user_id": "8f0c...",
  "organization_id": "c21a...",
  "purpose": "newsletter",
  "reason": "withdrawn",
  "due_at": "2026-12-24T09:12:00+00:00"
}
```

Erase the data in your systems and ask your processors to do the same, then mark the task done.

## Mark a task done from your app

Use an [API key](https://docs.aiveth.com/account/api-keys.md) with the `erasure:write` power.

List the tasks still open:

```bash theme={null}
curl "https://accounts.aiveth.com/v1/admin/erasures?status=open" \
  -H "Authorization: Bearer aiveth_sk_live_..."
```

Mark one erased:

```bash theme={null}
curl -X POST https://accounts.aiveth.com/v1/admin/erasures/4b1e.../done \
  -H "Authorization: Bearer aiveth_sk_live_..."
```

Each task in the response has:

**id** `string`

The task id.

**user\_id** `string`

The person.

**purpose** `string`

The purpose key.

**purpose\_title** `string`

The purpose's title.

**reason** `string`

`withdrawn` or `expired`.

**created\_at** `string`

When it opened.

**due\_at** `string`

When it is due.

**status** `string`

`open`, `done`, `held` or `cancelled`.

**done\_at** `string`

When it was marked done.

**done\_by** `string`

Who marked it done, for example the API key's name.

**held\_reason** `string`

Why it is kept by law.

**held\_until** `string`

Until when it is kept.

**late** `boolean`

True when it is open and past its due date.

| Status | Meaning |
| - | - |
| `404` | No such erasure in your organization. |
| `409` | This erasure is already closed. |

## Mark a task done in the console

For a system with no API, an admin closes the task. In **Privacy** → **Data to erase**, select **Mark erased**.

## Keep data by law (legal hold)

If a law requires you to keep the data, select **Keep by law…** on the task and fill in:

* **Which law, and why it needs this data** (5 to 500 characters)
* **Keep until**: a future date, at most 10 years away

When that date passes, the task opens again.

## Late tasks

Your organization's Owners get an email once a day about tasks past their due date.

## The record

Every step (opened, done, held, cancelled) is written to the [activity log](https://docs.aiveth.com/privacy/activity-log-and-reports.md). Each person can see what was erased or kept after their consent ended on their own privacy page.

## Related

* [Consent](https://docs.aiveth.com/privacy/consent.md)
* [Data rights](https://docs.aiveth.com/privacy/data-rights.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.