Chat

Mark a chat thread read

  • Sandbox: available
  • On your own host? Choose https://{host} in the playground.
POST
/v1/chat/threads/{threadId}/read

Marks the thread read by you, up to readAt (now when not sent): your unread count goes to 0, and everyone in the thread hears chat.read with the time, for read receipts.

Example

curl -X POST 'https://api.sandbox.ovok.com/v1/chat/threads/<threadId>/read' \  -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE3NjcyNjg4MDAsImV4cCI6MTc2NzI3MjQwMH0.Ql3B_ztDvctlyZ2z0vp4sl3ExXRQGkzmxdmTAqxNzZk' \  -H 'Content-Type: application/json' \  -d '{ "readAt": null }'

Authorization

bearer
headerAuthorizationBearer <JWT>

Path Parameters

threadId*string

The thread id.

Match^[A-Za-z0-9\-.]{1,64}$

Request Body

application/json
  1. body
readAt?string

Read up to this instant; now when not sent.

Formatdate-time
Defaultnull

Response Body

Read: nothing is unread for you, and the others see when you read it.

Example Request
curl -X POST 'https://api.sandbox.ovok.com/v1/chat/threads/string/read' \  -H 'Content-Type: application/json' \  -d '{}'
Example Response
Empty

Download a chat attachment GET

Answers a link that downloads a file sent with a message. Whoever can read the message can download its files. ## Behaviour - The link works for an hour and needs no bearer, so it fits a browser tab, a download or a PDF viewer. Ask again for a fresh one when it has run out. - An id the message does not carry answers **404** `CHAT_ATTACHMENT_NOT_FOUND`. ## Example ```bash curl 'https://api.sandbox.ovok.com/v1/chat/threads/<threadId>/messages/<messageId>/attachments/<attachmentId>' \ -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE3NjcyNjg4MDAsImV4cCI6MTc2NzI3MjQwMH0.Ql3B_ztDvctlyZ2z0vp4sl3ExXRQGkzmxdmTAqxNzZk' ```

Upload a chat attachment POST

Starts an upload of a file to send in chat: a PDF, PNG, JPEG or WebP of up to 10 MB. Ovok keeps it private; your access policy needs no document rights. ## Behaviour - The answer names the attachment (`id`) and where to upload its file: `POST` it to `upload.url` within ten minutes as multipart form data, every one of `upload.fields` first and the file last as `file`. - Then send it with a message: `POST /v1/chat/threads/<threadId>/messages` with `attachments: ["<id>"]`. One upload can go into any number of your threads. - Only you can send your upload. Everyone who can read a message it went out with can download it. ## Example ```bash curl -X POST 'https://api.sandbox.ovok.com/v1/chat/attachments' \ -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE3NjcyNjg4MDAsImV4cCI6MTc2NzI3MjQwMH0.Ql3B_ztDvctlyZ2z0vp4sl3ExXRQGkzmxdmTAqxNzZk' \ -H 'Content-Type: application/json' \ -d '{ "fileName": "Flu vaccination 2026.pdf", "contentType": "application/pdf" }' ```