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

# Consent

> Publish a consent notice, ask people for consent, and record, check and withdraw it from your own app.

Aiveth by Gooclaim helps you meet the consent duties of India's Digital Personal Data Protection Act, 2023 (Section 6). You write a notice that lists what you use people's data for. Aiveth asks each person when they sign in to one of your apps, keeps every answer as tamper-evident proof, and lets people withdraw as easily as they gave consent.

Consent is on every plan.

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

## How it works

1. You publish a **consent notice** with one or more **purposes**.
2. When a person signs in to one of your apps and hasn't answered the current notice, Aiveth shows its consent screen. Or your app shows its own screen and records the answer through the admin API.
3. Each answer is recorded with the notice version, the time, where it was given and the language.
4. The answers ride in the ID token as `consent`, and your apps get a webhook when an answer changes.
5. People change their answers on their account page at any time.

## Write a consent notice

You need a role that can manage security.

**1. Open Privacy**

In the console, go to **Privacy** and find **Consent notice**. Select **Write a notice** (or **New version** if you have one).

**2. Add each purpose**

For each purpose, fill in:

* **Title**
* **What it's for**, in plain words
* **Data it uses**, separated by commas (1 to 30 items)

**3. Mark at most one purpose as needed**

One purpose may be needed to use the app. Say **Why it's needed**. Every other purpose is optional, and people choose each one on its own.

**4. Set how long a yes lasts (optional)**

For an optional purpose, **How long a yes lasts** can be 30 to 3,650 days. See [Time-bound purposes](#time-bound-purposes).

**5. Say who else gets the data**

List each organization you share the data with and what it gets, for example "Amazon Web Services: email, to send sign-in codes".

**6. Say who answers questions**

Under **Who answers questions about the data**, give a name and an email people can reach.

**7. Preview and publish**

Check the **Preview**, then publish.

A notice has 1 to 20 purposes. Each purpose has a key of 2 to 41 lower-case letters, digits or underscores, which your code uses.

Notices are versioned and never edited. Publishing a change makes a new version, and everyone is asked again at their next sign-in to an app.

### Add a translation

The notice is in English. You can add your own translation of the current version in any of the 22 languages of the Eighth Schedule (Assamese, Bengali, Bodo, Dogri, Gujarati, Hindi, Kannada, Kashmiri, Konkani, Maithili, Malayalam, Manipuri, Marathi, Nepali, Odia, Punjabi, Sanskrit, Santali, Sindhi, Tamil, Telugu, Urdu).

Translate every purpose, including each data item. A translation is added, never changed, so what a person read stays provable. To change it, publish a new version. People see the notice in their browser's language when you have it, and can pick another. The language a person read is recorded with their answer.

## The consent screen

When a person signs in to your app and the notice is new to them, Aiveth shows each purpose in plain words, the data it uses, and who answers questions. The needed purpose is ticked and fixed, with why. Nothing else is pre-ticked. The person selects **Continue** and goes back to your app.

If you check people's age, children see the [parental consent](https://docs.aiveth.com/privacy/children.md) flow instead. A child never answers the notice.

## Read consent in your app

The ID token carries the person's answers to the current notice:

```json theme={null}
{
  "sub": "8f0c...",
  "consent": { "account": true, "newsletter": false }
}
```

Your app also gets these webhooks:

* `consent.given` when a person says yes to a purpose.
* `consent.withdrawn` when a person says no, withdraws, or a time-bound yes ends.

Stop using the data for a purpose as soon as you get `consent.withdrawn`. Aiveth may also open an [erasure task](https://docs.aiveth.com/privacy/erasure.md).

## Record consent from your own app

If your app asks for consent on its own screen, your server records the answer through the admin API. Use an [API key](https://docs.aiveth.com/account/api-keys.md) with these powers:

* `consent:read` to check and read answers and receipts.
* `consent:write` to record, withdraw and import answers.

Show the person the current notice version's words, then send their answers.

### Record answers

```bash theme={null}
curl -X POST https://accounts.aiveth.com/v1/admin/consents \
  -H "Authorization: Bearer aiveth_sk_live_..." \
  -H "Content-Type: application/json" \
  -d '{
    "person_id": "8f0c...",
    "notice_version": 3,
    "choices": { "account": true, "newsletter": false },
    "language": "hi"
  }'
```

**person\_id** `string` *required*

The person's Aiveth id. They must belong to your organization.

**notice\_version** `integer` *required*

The notice version the person read. If it isn't the current version, you get `409` and should show the new notice.

**choices** `object` *required*

`{purpose: true | false}`. The first time, answer every purpose. A needed purpose can't be answered no.

**language** `string`

The language the notice was shown in, when you added that translation.

The response is `{ "person_id": "...", "consents": { "account": true, "newsletter": false } }`.

Recording the same answer again changes nothing and sends no second event, so retries are safe.

### Check before you use data

Ask before you use a person's data for a purpose:

```bash theme={null}
curl "https://accounts.aiveth.com/v1/admin/consents/check?person_id=8f0c...&purpose=newsletter" \
  -H "Authorization: Bearer aiveth_sk_live_..."
```

```json theme={null}
{
  "granted": true,
  "notice_version": 3,
  "current": true,
  "at": "2026-11-20T09:12:00Z",
  "expires_at": null
}
```

`granted` is true only when the person said yes to the current notice's version of that purpose and the yes hasn't ended.

### Read answers

`GET /v1/admin/consents/{person_id}` returns `{person_id, consents}` for the current notice.

### Withdraw

Offer withdrawal in your app's settings, as easy as giving consent:

```bash theme={null}
curl -X DELETE https://accounts.aiveth.com/v1/admin/consents/8f0c.../newsletter \
  -H "Authorization: Bearer aiveth_sk_live_..."
```

The response is the person's answers after the change. A needed purpose can't be withdrawn this way. To stop it, the person deletes their account.

## Signed consent receipts

A consent receipt is a signed record of what a person agreed to. You and the person both hold it.

* People download theirs from their account page (`consent-receipt.json`).
* Your server gets one with `GET /v1/admin/consents/{person_id}/receipt`, which returns `{receipt, claims}`.

The receipt is a JWT with `typ` `consent-receipt+jwt`, signed with Aiveth's key. Check it against Aiveth's JWKS. It has no `aud`, so it is never mistaken for an ID token. Its claims include:

* `sub`, the person, and `controller`: your organization's id, name and contact
* `notice`: the version and when it was published
* `purposes`: for each one, the data it uses, whether it is needed, yes or no, when, where it was given, the language, and when a time-bound yes ends
* `shared_with`, `withdraw` (where to change it), `jurisdiction` (`IN`) and `law`
* `chain`: the fingerprint of the person's last answer in your organization's record

The same answers always give the same receipt `jti`. Any change gives a new one. If there is no notice, or the person hasn't answered, you get `404`.

## Time-bound purposes

An optional purpose can last 30 to 3,650 days. Aiveth then:

* reminds the person by email 30, 7 and 1 days before it ends, once each
* turns the yes into a no when the day comes, recorded as expired, and sends `consent.withdrawn`
* asks again at the person's next sign-in

Only the person's own yes renews it. Aiveth never renews it for them.

## People change their own answers

On their account page, each person sees your notice and one switch per optional purpose. Turning a switch off is recorded at once and your apps are told. People get an email whenever an answer changes something. The email's button opens their account page, where they can change it again or download their receipt.

## Import earlier consent

If people gave consent before you used Aiveth, bring it in:

```bash theme={null}
curl -X POST https://accounts.aiveth.com/v1/admin/consents/import \
  -H "Authorization: Bearer aiveth_sk_live_..." \
  -H "Content-Type: application/json" \
  -d '{
    "notice_version": 3,
    "people": [
      {
        "email": "asha@example.com",
        "choices": { "account": true, "newsletter": true },
        "given_at": "2025-06-01T10:00:00+05:30",
        "source": "Signup form, old website"
      }
    ]
  }'
```

* Up to 500 people per call, each by `person_id` or `email`, answering every purpose of the current notice.
* `given_at` is a past date and time with a time zone. Without it, now is used.
* A time-bound yes counts its days from `given_at`, so it may already have ended.
* Imported answers are recorded as imported, with the source in the activity log. People aren't emailed.
* Importing the same file again changes nothing. An older answer never replaces one the person gave in Aiveth since.

The response is `{recorded, unchanged, skipped}`. `skipped` lists each person not brought in, with the row and why. One refused row never stops the others.

Sending people a notice about consent they gave earlier stays your job.

## The proof

In the console, **Privacy** → **Consent records** shows every yes and no, with the notice version and where it was given.

* **Download CSV** gives every answer ever.
* **Check the record is untouched** verifies that no answer has changed. Answers are kept in an append-only record where each entry is linked to the one before by a keyed hash.

## Errors

| Status | Meaning |
| - | - |
| `404` | Your organization hasn't published a notice, or the person isn't in your organization. |
| `409` | The notice changed. Show the new one and ask again. |
| `422` | Not one of your purposes, a purpose not answered, or a needed purpose answered no. |

## Related

* [Consent Managers](https://docs.aiveth.com/privacy/consent-managers.md)
* [Erasure](https://docs.aiveth.com/privacy/erasure.md)
* [Children](https://docs.aiveth.com/privacy/children.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.