# ovok.consent

Canonical page: https://docs.ovok.com/web-sdk/core/namespaces/consent

Consent of the signed-in user. Legal consent covers the terms and conditions; medical consent covers medical notifications.

## Read and record legal consent [#read-and-record-legal-consent]

```ts
const { legal } = await ovok.consent.legal.retrieve();

const mustAccept = legal === null || (legal.status === 'revoked' && legal.revokedReason === 'tos-updated');

if (mustAccept) {
  await ovok.consent.legal.set(true);
}
```

- `legal` is `null` when the user never answered. A revoked record with reason `tos-updated` means the terms changed and the user must accept again.
- `set(false)` withdraws consent.
- Calls `GET` and `POST v1/me/consent/legal`.

## Read and record medical consent [#read-and-record-medical-consent]

```ts
const { medical } = await ovok.consent.medical.retrieve();
await ovok.consent.medical.set(true);
```

- `medical` is `null` until the user answers; otherwise it carries `acceptedAt`.
- Calls `GET` and `POST v1/me/consent/medical`.

## Request a signature [#request-a-signature]

```ts
const request = await ovok.consent.requestSignature(consentId);
```

- Asks the server to start a signature for an existing consent. The response describes the document to sign (`documentId`, `title`, `numberOfPages`, `email`).

## Reference [#reference]

- [consent API reference](/web-sdk/core/reference/core/consent): every method and type.
- [ovok.cms](/web-sdk/core/namespaces/cms): legal pages to show before asking.
- [ovok.invites](/web-sdk/core/namespaces/invites)
- [Errors and retries](/web-sdk/core/errors-and-retries)
