---
title: "Read a file"
method: POST
path: "/extract"
tags: ["Files"]
---

# Read a file

`POST /extract`

## Request

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

Reads any file into Markdown ready for a model: Word, PowerPoint, Excel, PDF, .doc/.ppt/.xls, TXT, Markdown or HTML.

## Request body

- object
  - `file` union, required
    - string: A file uploaded with POST /files.
    - string: A document Doconda already made, by its id: we use its Word, PowerPoint or Excel (or its PDF, if that is all it has).
    - object: We download it (public http/https, up to 20 MB).
      - `url` string, uri, required
      - `filename` string
    - object: The file's bytes in base64, with its name (the extension says the format).
      - `data` string, base64, required
      - `filename` string, required

## Response `200`

The text, as Markdown. Nothing is kept.

- object: The text of the file. Doconda keeps nothing once it has given it to you.
  - `object` 'extraction', required
  - `id` string, required
  - `format` 'docx' | 'pptx' | 'xlsx' | 'pdf' | 'doc' | 'ppt' | 'xls' | 'txt' | 'md' | 'html' | 'png' | 'jpg' | 'gif' | 'webp', required
  - `markdown` string, required: Headings, lists and tables kept; one section per slide or sheet; page markers in a PDF. Scanned pages and pictures are read with OCR.
  - `chars` integer, required: Length of the whole text, before any cut.
  - `truncated` boolean, required: true when longer than 2 000 000 characters.
  - `pages` integer, nullable, required: Pages (PDF), slides (PowerPoint) or sheets (Excel).

## Other responses

- `202`: Past 120 s: pick it up with GET /extract/{id}.
- `401`: unauthorized (missing, unknown or revoked key; expired session).
- `413`: file_too_large
- `422`: file_rejected / file_unreachable, or the file could not be read

---

[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)
