---
title: "Extract text from a document"
method: POST
path: "/v1/document/extract_text"
tags: ["Text Extraction"]
---

# Extract text from a document

`POST /v1/document/extract_text`

Upload a document (digital or scanned) in Base64 format and extract its text. Returns a `file_id` to track processing status.

## Request body

- object
  - `file_content` string, required — Base64 encoded input document
  - `language` 'english', required — Language of the input document
  - `file_type` 'Digital' | 'Scanned', required — Type of input document

## Response `200`

Text extraction initiated successfully

- object
  - `code` integer
  - `data` object
    - `file_id` string — The ID to track the status
    - `action` string
    - `file_status` string
    - `output_type` string
  - `http_status` string
  - `timestamp` integer — Unix timestamp
  - `status` string

## Other responses

- `400` — Bad Request — Invalid request format or parameters.
- `404` — Not Found — The requested resource was not found.
- `422` — Unprocessable Entity — Validation failed.
- `429` — Too Many Requests — Rate limit exceeded.
- `500` — Internal Server Error.
- `502` — Bad Gateway — Upstream service error.
- `503` — Service Unavailable — Try again later.

---

[API](https://skmtc.net/olakrutrim/apis/object-storage-bucket-api.md) · [All operations](https://skmtc.net/olakrutrim/apis/object-storage-bucket-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/olakrutrim/object-storage-bucket-api/revisions/01a982e59414/schema)
