# Accept or withdraw the terms

Canonical page: https://docs.ovok.com/api/me/consent/accept-or-withdraw-the-terms

`POST /v1/me/consent/legal`

Accepts or withdraws the terms for the signed-in practitioner and returns the resulting legal consent.

**Auth:** Bearer token for a practitioner session (the profile must be a `Practitioner`). The caller's access policy must grant `Consent:read`, `Consent:search`, `Consent:create` and `Consent:update` (a project admin who holds no access policy skips this check).
**Scope:** The caller's practitioner profile in the caller's project (from the token).

## Behaviour

- `termsAndConditionsConsent: true` records acceptance of the currently published terms. It creates the legal consent, or re-activates a revoked one, with a link to the terms page of your project's practitioner app and the time of acceptance.
- `termsAndConditionsConsent: false` revokes an active legal consent with `revokedReason: "withdrawn"`. With no active consent it changes nothing.
- Accepting again on the same terms version writes nothing.
- The terms value read by `GET /v1/slim/user/consents` changes in the same commit. Other consents are not changed.
- The response has the shape of `GET /v1/me/consent/legal`.


## Example

```bash
curl -X POST 'https://api.sandbox.ovok.com/v1/me/consent/legal' \
  -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE3NjcyNjg4MDAsImV4cCI6MTc2NzI3MjQwMH0.Ql3B_ztDvctlyZ2z0vp4sl3ExXRQGkzmxdmTAqxNzZk' \
  -H 'Content-Type: application/json' \
  -d '{ "termsAndConditionsConsent": true }'
```
