# Upload a chat attachment

Canonical page: https://docs.ovok.com/api/chat/upload-a-chat-attachment

`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

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