# Delete patient

Canonical page: https://docs.ovok.com/slim-apis/patient/delete-patient

| Method | Path |
| --- | --- |
| `DELETE` | `/v1/slim/patient/:id` |

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

Deletes a resident (patient) who has no device.

**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 `Patient:delete` and `Device:update` (admins and super admins skip this check).
**Scope:** The resident must belong to the caller's project (from the token).

## Request [#request]

### Path parameters [#path-parameters]

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | `string (uuid)` | Yes | Patient id. |

## Behaviour [#behaviour]

- A resident who is still assigned to a device cannot be deleted. The request returns `409` and changes nothing. The message names each device by its `DeviceID` identifier, or by its name when it has no `DeviceID`.
- First remove the resident from every device with `PUT /v1/slim/patient/{id}` without `locationId`, then delete the resident.
- Only the Patient resource is deleted. This route does not delete the resident's other records.
- Archived residents cannot be deleted.
- The response has no body.

## Example [#example]

```bash
curl -X DELETE 'https://api.sandbox.ovok.com/v1/slim/patient/3f1c2b7e-8d4a-4c1e-9b2f-6a7d5e4c3b21' \
  -H "Authorization: Bearer ${OVOK_TOKEN}"
```

## Successful response [#successful-response]

`200` — Patient deleted. The response has no body.

## Errors [#errors]

| Status | Meaning |
| --- | --- |
| [`400`](/errors/malformed-request) | The FHIR backend refuses the delete. |
| [`401`](/errors/unauthenticated) | Bearer token is missing, invalid or expired. |
| [`403`](/errors/forbidden) | You are not a practitioner, admin or System Owner, you lack `Patient:delete` or `Device:update`, or the patient is outside your project. |
| [`404`](/errors/not-found) | No patient with this id exists. |
| [`409`](/errors/conflict) | The resident still has a device: `Resident still has device <serial>[, <serial>]. Unassign it first.` Nothing changes. A concurrent write or device reassignment also returns [`409`](/errors/conflict); retry. |
| [`422`](/errors/validation-failed) | `id` is not a UUID, or the patient is archived. |
