# Update medical settings notifications consent

Canonical page: https://docs.ovok.com/slim-apis/user/update-medical-settings-notifications-consent

<Callout type="warn" title="Deprecated">

This route is deprecated. Use [`POST /v1/me/consent/medical`](/authentication/account/update-medical-consent) instead. The replacement returns the resulting consent with its id and acceptance time.

</Callout>

| Method | Path |
| --- | --- |
| `POST` | `/v1/slim/user/medical-settings-notifications-consent` |

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

Gives or withdraws the medical settings notifications consent for the signed-in practitioner. Other consents are not changed.

**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` | Yes | `true` gives the consent on the currently published version. `false` withdraws it. |

## Behaviour [#behaviour]

- `true` records the consent on the currently published version. `false` withdraws it.
- Sending the current value again writes nothing.
- The write is atomic. It either succeeds completely or changes nothing.
- The consent answers of `/v1/me/consent/*` are refreshed right away.
- The response carries the resulting `medicalSettingsNotificationsConsent`.

## Example [#example]

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

## Successful response [#successful-response]

`201` — Medical settings notifications consent updated successfully.

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

| Field | Type | Description |
| --- | --- | --- |
| `medicalSettingsNotificationsConsent` | `boolean` | The resulting state: `true` after giving the consent, `false` after withdrawing 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 `medicalSettingsNotificationsConsent` is missing or not a boolean. |
| [`429`](/errors/too-many-requests) | Too many requests. |
| [`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. |
