Update document metadata
- Sandbox: available
- Staging: available
- Production: unknown
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.
contentTypemust be one of the allowed types listed underPOST /document. It changes both the DocumentReference and the stored file's content type.isPublic: truegives a private document a public token.isPublic: falseremoves 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
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 }'bearerAuthorizationBearer <JWT>id*stringThe id of the DocumentReference resource
uuidapplication/json- body
fileName?stringThe new name of the file.
1 <= lengthisPublic?booleanWhether the file should be public or private.
contentType?stringThe MIME type of the file.
The updated document.
application/json- response
id*stringThe ID of the DocumentReference resource.
meta?The metadata of the document.
author?The author of the document.
fileName?stringThe name of the document.
contentType?stringThe content type of the document.
uploadOptions?The upload options of the document.
publicToken?stringThe public token of the document.
curl -X PATCH 'https://api.sandbox.ovok.com/document/497f6eca-6276-4993-bfeb-53cbbbba6f08' \ -H 'Content-Type: application/json' \ -d '{}'{ "id": "string", "meta": { "lastUpdated": "string" }, "author": { "reference": "string", "display": "string" }, "fileName": "string", "contentType": "string", "uploadOptions": { "url": "string", "fields": { "property1": "string", "property2": "string" } }, "publicToken": "string"}Create document replacement credentials POST
Replaces the file of an existing document. It updates the document's metadata and returns a signed upload form, as `POST /document` does. **Auth:** bearer token. The document is read and updated with your token, so you need update access to the DocumentReference. ## Behaviour - `fileName` and `contentType` are required and set on the document. `isPublic` is optional and works as in `PATCH /document/{id}`. - The current file is deleted before the upload form is returned. Until you upload the new file, the document has no file to download. - The document keeps its id, so existing references to it stay valid. - Upload with `uploadOptions` as described for `POST /document`. The form expires after 10 minutes. ## Example ```bash curl -X POST '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": "new-cat.png", "contentType": "image/png" }' ```
Delete a document DELETE
Deletes a document and its stored file. This cannot be undone. **Auth:** bearer token. The document is read and deleted with your token, so you need read and delete access to the DocumentReference. ## Behaviour - The stored file is deleted first, then the DocumentReference. - If deleting the stored file fails, the DocumentReference is still deleted. - Public links to the document stop working. ## Example ```bash curl -X DELETE 'https://api.sandbox.ovok.com/document/c3499c27-2973-0a7f-807e-fb8676a92dcb' \ -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE3NjcyNjg4MDAsImV4cCI6MTc2NzI3MjQwMH0.Ql3B_ztDvctlyZ2z0vp4sl3ExXRQGkzmxdmTAqxNzZk' ``` ```json { "message": "Document deleted successfully" } ```