Update document metadata
PATCH
/document/{id}dev
https://api.sandbox.ovok.comUpdate document metadata
Updates the name and/or publicity settings of an uploaded document.
Parameters
| Parameter | In | Description | Example |
|---|---|---|---|
id | path | The id of the DocumentReference resource to update | 023f2f- |
fileName | body | The new filename for the document (optional) | cat.png |
isPublic | body | Whether the document should be publicly accessible (optional, true or false) | false |
Request Body
{
"fileName": "updated-image.png",
"isPublic": "false"
}
Response
Returns the updated document information in the same format as the create endpoint:
{
"id": "12345",
"meta": {
"lastUpdated": "2000-01-01T00:00:00.000Z"
},
"author": {
"reference": "Practitioner/...",
"display": "Max Mustermann"
},
"fileName": "updated-image.png",
"contentType": "image/png",
"publicToken": null
}
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | yes | FHIR DocumentReference id whose metadata should be updated (e.g. file name, author, content type). The binary itself is not changed — use POST /document/:id to replace the file. |
Request body
Content-Type: application/json
fileName:string— The new name of the file.isPublic:boolean— Whether the file should be public or private.contentType:string— The MIME type of the file.
Responses
| Code | Description |
|---|---|
200 | Success. |
400 | The request could not be operated by the server. |
401 | The resource owner or authorization server denied the request. |
404 | The requested resource could not be found. |
422 | The request could not be validated by the server. |
500 | The server encountered an unexpected condition. Please try again later. |
200 → FileEntryDto (application/json)
id:string(required) — The ID of the DocumentReference resource.meta:object— The metadata of the document.lastUpdated:string(required) — The last updated date of the document.
author:object— The author of the document.reference:string— The reference of the author.display:string— The display name of the author.
fileName:string— The name of the document.contentType:string— The content type of the document.uploadOptions:object— The upload options of the document.url:string(required) — The upload URL of the document.fields:object(required) — The fields of the document.
publicToken:string— The public token of the document.
Example
{
"id": "87ea5dfc-8b8e-384d-8489-79496e706390",
"fileName": "test.txt",
"contentType": "text/plain",
"publicToken": "example.jwt.eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE3NzkzNTA5NzEsImV4cCI6MTc3OTM1NDU3MX0.PO6ZkOtyOEugGyNuZUyg_YxUt3ozpJ_QOdJuriC14uY",
"uploadOptions": {
"url": "https://example.com/upload",
"fields": {
"key": "value"
}
}
}