Chat

Upload a chat attachment

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

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

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

Authorization

bearer
headerAuthorizationBearer <JWT>

Request Body

application/json
  1. body
fileName*string

The file’s name, as readers see it.

Length1 <= length <= 200
contentType*string

The file’s type: a PDF, PNG, JPEG or WebP.

Value in"application/pdf""image/png""image/jpeg""image/webp"

Response Body

The attachment and where to upload its file. Location names it.

application/json
  1. response
id*string

The attachment id.

title*string

The file’s name.

contentType*string

The file’s type.

upload*

POST the file to url within ten minutes as multipart form data: every one of fields, then file. At most 10 MB.

Example Request
curl -X POST 'https://api.sandbox.ovok.com/v1/chat/attachments' \  -H 'Content-Type: application/json' \  -d '{  "fileName": "string",  "contentType": "application/pdf"}'
Example Response
{  "id": "string",  "title": "string",  "contentType": "string",  "upload": {    "url": "string",    "fields": {      "property1": "string",      "property2": "string"    }  }}