# Delete access policy

Canonical page: https://docs.ovok.com/api/slim/policy/delete-access-policy

`DELETE /v1/slim/policy/{id}`

Deletes an access policy (role) of your project and detaches it from everyone who holds it.

**Auth:** Bearer token for a practitioner, project admin or System Owner session. The caller's access policy must grant `AccessPolicy:delete` and `ProjectMembership:update` (a project admin who holds no access policy skips this check).
**Scope:** The policy must belong to the caller's project (from the token).

## Behaviour

- A policy is not deleted while a holder would be left with no role (no `access` entry, not a project admin): the request answers 409 until they are moved to another role, because Medplum reads a membership with no policy as full access. Other holders are detached.
- You cannot delete a policy you hold yourself.
- You cannot delete a policy held by anyone whose role ranks above yours (a project admin ranks as System Owner), since that takes their role away.
- Detaching the members and deleting the policy commit together. Past 49 membership changes they are written in two steps.
- The policy's copies of the same name in direct child projects are then deleted. A failed copy delete does not fail the request.
- Returns an empty body.


## Example

```bash
curl -X DELETE 'https://api.sandbox.ovok.com/v1/slim/policy/c3499c27-2973-0a7f-807e-fb8676a92dcb' \
  -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE3NjcyNjg4MDAsImV4cCI6MTc2NzI3MjQwMH0.Ql3B_ztDvctlyZ2z0vp4sl3ExXRQGkzmxdmTAqxNzZk'
```
