# Update user consents

Canonical page: https://docs.ovok.com/slim-apis/user/update-user-consents

| Method | Path |
| --- | --- |
| `POST` | `/v1/slim/user/consents` |

[Authentication](/authentication) · [Access policies](/access-policies)

Updates one or more consents of the signed-in practitioner. Use it to save the answers of a combined consent prompt.

**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` (project admins skip this check).
**Scope:** The caller's practitioner profile in the caller's project (from the token).

## Request [#request]

### Body [#body]

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `medicalSettingsNotificationsConsent` | `boolean` | No | `true` accepts the currently published medical settings and notifications consent. `false` withdraws it. Omit to leave it unchanged. |
| `termsAndConditionsConsent` | `boolean` | No | `true` accepts the currently published terms and conditions. `false` withdraws the acceptance. Omit to leave it unchanged. |

At least one of the two fields is required. `null` and other types are refused.

## Behaviour [#behaviour]

- Send at least one of `medicalSettingsNotificationsConsent` and `termsAndConditionsConsent`. Only the fields you send change.
- `true` records acceptance of the currently published version of that consent. `false` withdraws it.
- A `termsAndConditionsConsent` change also creates, re-activates or revokes the legal `Consent` read by `GET /v1/me/consent/legal`.
- All changes commit together or not at all. Repeating the same values writes nothing.
- The consent answers of `/v1/me/consent/*` are refreshed right away.
- The response always carries the resulting state of every consent.


## Example [#example]

```bash
curl -X POST 'https://api.sandbox.ovok.com/v1/slim/user/consents' \
  -H "Authorization: Bearer ${OVOK_TOKEN}" \
  -H 'Content-Type: application/json' \
  -d '{ "medicalSettingsNotificationsConsent": true, "termsAndConditionsConsent": true }'
```

## Successful response [#successful-response]

`201` — Consent statuses updated successfully.

```json
{
  "medicalSettingsNotificationsConsent": true,
  "termsAndConditionsConsent": true
}
```

| Field | Type | Description |
| --- | --- | --- |
| `medicalSettingsNotificationsConsent` | `boolean` | The resulting state: the value you sent, or the unchanged state when you omitted it. |
| `termsAndConditionsConsent` | `boolean` | The resulting state: the value you sent, or the unchanged state when you omitted it. |

## Errors [#errors]

| Status | Meaning |
| --- | --- |
| [`400`](/errors/malformed-request) | The FHIR server refused the consent write. |
| [`401`](/errors/unauthenticated) | The bearer token is missing or invalid. |
| [`403`](/errors/forbidden) | The session is not a practitioner session, has no project, or its access policy lacks one of the `Consent` interactions. |
| [`409`](/errors/conflict) | The consent write lost a [`conflict`](/errors/conflict) with a concurrent write. Retry. |
| [`422`](/errors/validation-failed) | The body fails validation, for example a value is not a boolean, or it contains neither consent field. |
| [`500`](/errors/internal-error) | The write failed unexpectedly, or failed and could not be fully rolled back. |
| [`503`](/errors/service-unavailable) | Your access policy could not be read, or the service is temporarily over capacity. Retry shortly, and honour `Retry-After` when it is present. |
