Document

Update document metadata

  • Sandbox: available
  • Staging: available
  • Production: unknown
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

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 }'

Authorization

bearer
headerAuthorizationBearer <JWT>

Path Parameters

id*string

The id of the DocumentReference resource

Formatuuid

Request Body

application/json
  1. body
fileName?string

The new name of the file.

Length1 <= length
isPublic?boolean

Whether the file should be public or private.

contentType?string

The MIME type of the file.

Response Body

The updated document.

application/json
  1. response
id*string

The ID of the DocumentReference resource.

meta?

The metadata of the document.

author?

The author of the document.

fileName?string

The name of the document.

contentType?string

The content type of the document.

uploadOptions?

The upload options of the document.

publicToken?string

The public token of the document.

Example Request
curl -X PATCH 'https://api.sandbox.ovok.com/document/497f6eca-6276-4993-bfeb-53cbbbba6f08' \  -H 'Content-Type: application/json' \  -d '{}'
Example Response
{  "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" } ```