# Delete public resource token

Canonical page: https://docs.ovok.com/api/public-resource-access/delete-public-resource-token

`DELETE /public/{resourceType}/{id}`

Removes the public token from a resource, so it can no longer be read with `GET /public/{token}`. The resource itself is kept.

**Auth:** bearer token of a project admin.

## Behaviour

- The resource must be in the caller's project or one of its sub-projects. A resource of any other project, the parent project included, answers `403` and is left unchanged; an unknown id answers `404`.
- Removes the `meta.extension` entry with the URL `https://api.ovok.com/fhir/StructureDefinition/public-resource-token`. Other extensions are kept.
- Calling it on a resource without a token succeeds.
- The response is `{ token: null, resource }` with the updated resource.

## Example

```bash
curl -X DELETE 'https://api.sandbox.ovok.com/public/DocumentReference/87ea5dfc-8b8e-384d-8489-79496e706390' \
  -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE3NjcyNjg4MDAsImV4cCI6MTc2NzI3MjQwMH0.Ql3B_ztDvctlyZ2z0vp4sl3ExXRQGkzmxdmTAqxNzZk'
```
