Skip to content

Upload files

Endpoint

POST /bot/files/upload

This is a dedicated bot-only upload endpoint.

Auth

http
Authorization: Bearer <token>

Request format

multipart/form-data, form field name: files

Upload file example with curl

bash
curl -X POST \
  -H "Authorization: Bearer <token>" \
  -F "files=@invoice.pdf" \
  https://public-api.hcapp.ee/bot/files/upload

Multiple files:

bash
curl -X POST \
  -H "Authorization: Bearer <token>" \
  -F "files=@invoice.pdf" \
  -F "files=@photo.jpg" \
  https://public-api.hcapp.ee/bot/files/upload

The file does not have to be attached to a task at upload time.
Returned file_id values can later be sent to POST /bot/forms/{form_id}/tasks.

Response body

Each returned file object contains:

json
{
  "file_id": 9001,
  "filename": "invoice.pdf",
  "url": "https://public-api.hcapp.ee/uploads/9001",
  "temp_url": "https://public-api.hcapp.ee/uploads/temp/9001",
  "expired_at": "2026-03-29T10:00:00+00:00"
}
json
{
  "success": true,
  "error_message": null,
  "data": [
    {
      "file_id": 9001,
      "filename": "invoice.pdf",
      "url": "https://public-api.hcapp.ee/uploads/9001",
      "temp_url": "https://public-api.hcapp.ee/uploads/temp/9001",
      "expired_at": "2026-03-29T10:00:00+00:00"
    }
  ]
}

Limits

  • Up to 20 MB per file
  • Rate limit: 10/min

Allowed extensions:

  • .pdf
  • .png
  • .jpg
  • .jpeg
  • .gif
  • .webp
  • .txt
  • .csv
  • .doc
  • .docx
  • .xls
  • .xlsx
  • .html
  • .mp3
  • .wav
  • .m4a
  • .ogg
  • .mp4
  • .mov
  • .webm

Both extension and content_type are validated.

Errors

  • 400 No files provided
  • 400 File extension is not allowed: ...
  • 400 File too large. Up to 20MB allowed
  • 400 Invalid file content type for .ext: ...
  • 429 Rate limit exceeded. Retry after {seconds} seconds