# Update document metadata

Canonical page: https://docs.ovok.com/api/document/update-document-metadata

`PATCH /document/{id}`

Changes a document's file name, content type or public status, without uploading a new file.

**Auth:** bearer token. The document is read and updated with your token, so you need update access to the DocumentReference.

## Behaviour

- Every field is optional. Fields you leave out keep their value.
- `contentType` must be one of the allowed types listed under `POST /document`. It changes both the DocumentReference and the stored file's content type.
- `isPublic: true` gives a private document a public token. `isPublic: false` removes the public token, so existing public links stop working. Setting the status it already has changes nothing.
- The response has the same shape as a search entry, without `uploadOptions`.

## Example

```bash
curl -X PATCH 'https://api.sandbox.ovok.com/document/c3499c27-2973-0a7f-807e-fb8676a92dcb' \
  -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE3NjcyNjg4MDAsImV4cCI6MTc2NzI3MjQwMH0.Ql3B_ztDvctlyZ2z0vp4sl3ExXRQGkzmxdmTAqxNzZk' \
  -H 'Content-Type: application/json' \
  -d '{ "fileName": "updated-image.png", "isPublic": false }'
```
