---
title: "Upload a file"
method: POST
path: "/files"
tags: ["Files"]
---

# Upload a file

`POST /files`

## Request

- Base URL: `https://api.eu.doconda.com/v1`
- URL: `https://api.eu.doconda.com/v1/files`
- Auth: one of:
  - HTTP bearer
  - HTTP bearer

Uploads a Word, PowerPoint, Excel (also .doc/.ppt/.xls), PDF, TXT, Markdown, HTML or picture file, up to 20 MB: multipart, a URL or base64.

## Request body

- union: JSON alternative to multipart: a URL we download, or the bytes in base64.
  - object
    - `url` string, uri, required
    - `filename` string
  - object
    - `data` string, base64, required
    - `filename` string, required

## Response `201`

Stored.

- object
  - `id` string, required
  - `object` 'file', required
  - `filename` string, required
  - `content_type` string, required
  - `bytes` integer, required
  - `sha256` string, required
  - `pages` integer, nullable, required
  - `created_at` string, date-time, required

## Other responses

- `401`: unauthorized (missing, unknown or revoked key; expired session).
- `413`: file_too_large
- `422`: file_rejected: the content is not a supported file (macros are refused).

---

[API](https://skmtc.dev/doconda/apis/doconda-api.md) · [All operations](https://skmtc.dev/doconda/apis/doconda-api/llms.txt) · [OpenAPI document](https://skmtc.dev/doconda/apis/doconda-api/revisions/27d29a7e8902?raw)
