# Update practitioner

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

| Method | Path |
| --- | --- |
| `PUT` | `/v1/slim/practitioner/:id` |

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

Updates a practitioner profile: name, surname, email, phone, address and photo.

**Auth:** Bearer token. The caller must be a practitioner, an admin, a super admin, or hold the "System Owner" access policy. The access policy must grant `Practitioner:read`. Updating another practitioner's profile also needs `Practitioner:update`. Admins and super admins skip the access-policy check.
**Scope:** You can always update your own profile. Another practitioner must belong to your project, one of its sub-projects, or its parent project.

## Request [#request]

### Path parameters [#path-parameters]

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | `string` | Yes | Practitioner id. |

### Body [#body]

The body replaces the profile. A field you omit is cleared.

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | `string` | No | Practitioner id. When sent, it must equal the id in the path. |
| `name` | `string` | No | Given names, separated by spaces. |
| `surname` | `string` | No | Family name. |
| `email` | `string` | No | Email address. Must be valid. Stored in lower case. |
| `phone` | `string` | No | Phone number. |
| `address` | `object` | No | Postal address. |
| `address.line` | `string` | No | Street and number. |
| `address.city` | `string` | No | City. |
| `address.state` | `string` | No | State. |
| `address.postalCode` | `string` | No | Postal code. |
| `address.country` | `string` | No | Country. |
| `photo` | `string` | No | URL of a profile photo. Must be a valid URL. |
| `meta` | `object` | No | Ignored. Ovok sets the author to the caller. |
| `meta.author` | `string` | No | Ignored. When sent, it must look like `Practitioner/<id>`. |

## Behaviour [#behaviour]

- The Practitioner resource is **replaced** with one built from the body. A field you omit is cleared, and FHIR fields that the body cannot carry are not kept. Send the full profile, for example the result of `GET /v1/slim/practitioner/{id}` with your changes applied.
- `id` in the body is optional. When present it must equal the `id` in the path.
- `meta` in the body is ignored. Ovok sets `meta.author` to the caller.
- `email` is stored in lower case.
- This route does not change roles or access policies.
- A changed user name appears in [change history](/slim-apis/audit/list-change-history) as an `Access` row with key `userRenamed` and `from`/`to` values. No row is written when the name is unchanged. See the [key catalogue](/slim-apis/audit/change-history-keys).
- Your own profile is written with your token. Another practitioner's profile is written with Ovok's admin client after the project check above passes.
- The response is the updated profile.

## Example [#example]

```bash
curl -X PUT 'https://api.sandbox.ovok.com/v1/slim/practitioner/3f1c2b7e-8d4a-4c1e-9b2f-6a7d5e4c3b21' \
  -H "Authorization: Bearer ${OVOK_TOKEN}" \
  -H 'Content-Type: application/json' \
  -d '{
    "name": "Anna",
    "surname": "Beispiel",
    "email": "team@example.com",
    "phone": "+4930123456789"
  }'
```

## Successful response [#successful-response]

`200` — Practitioner profile updated successfully.

```json
{
  "id": "3f1c2b7e-8d4a-4c1e-9b2f-6a7d5e4c3b21",
  "name": "Anna",
  "surname": "Beispiel",
  "email": "team@example.com",
  "phone": "+4930123456789",
  "meta": { "author": "Practitioner/3f1c2b7e-8d4a-4c1e-9b2f-6a7d5e4c3b21" }
}
```

The body is the updated profile, in the same shape as `GET /v1/slim/practitioner/{id}`.

| Field | Type | Description |
| --- | --- | --- |
| `id` | `string (uuid)` | Practitioner id. |
| `name` | `string` | Given names of the official name, joined by a space. Left out when not set. |
| `surname` | `string` | Family name. Left out when not set. |
| `email` | `string` | Email address. Left out when not set. |
| `phone` | `string` | Phone number. Left out when not set. |
| `address` | `object` | First address. Left out when not set. |
| `address.line` | `string` | Street lines joined by a space. Left out when not set. |
| `address.city` | `string` | City. Left out when not set. |
| `address.state` | `string` | State. Left out when not set. |
| `address.postalCode` | `string` | Postal code. Left out when not set. |
| `address.country` | `string` | Country. Left out when not set. |
| `photo` | `string` | URL of the first photo. Left out when not set. |
| `meta` | `object` | Left out when the profile records no author. |
| `meta.author` | `string` | Reference to whoever last wrote the profile through Ovok, such as `Practitioner/<id>`. |

## Errors [#errors]

| Status | Meaning |
| --- | --- |
| [`400`](/errors/malformed-request) | The body `id` differs from the path, the profile cannot be read, or the FHIR backend refuses the update. |
| [`401`](/errors/unauthenticated) | Bearer token is missing, invalid or expired. |
| [`403`](/errors/forbidden) | You are not a practitioner, admin or System Owner, you lack `Practitioner:read` (plus `Practitioner:update` for someone else's profile), or the practitioner's project is outside your project tree. |
| [`404`](/errors/not-found) | No practitioner with this id exists, or it has no project (someone else's profile only). |
| [`422`](/errors/validation-failed) | The body fails validation. |
