documents

Enqueue a document for the extraction pipeline.

Creates a Document row with status='queued' and returns the document_id together with a polling URL. The actual extraction worker (Taskiq) is wired in US-5 (E5.3).

Limits: content must be non-empty and ≤ 1 000 000 bytes (UTF-8). Documents above 15 000 words are split into 4 parts (XL path) while ANDISH_XL_SPLIT_ENABLED is on (the default since ADR-037 A2); with the flag off (kill switch) they get 413 payload_too_large_xl_unavailable (detail: max_words, words). Hard cap: 50 000 words → 413 payload_too_large_xl_cap (detail includes words — actual word count — and parts_hint — suggested number of parts). Splitter failure on degenerate input → 422 xl_split_failed.

post/v1/documents

Request

  • Base URL: https://api.andish.ru (the document declares no server; this is the origin it was published from)
  • URL: https://api.andish.ru/v1/documents
  • Auth: none declared

Request body

contentstring nullable

Raw text to index (max 1 MB UTF-8). Documents above 15 000 words trigger automatic split into 4 parts (XL path); 50 000 words is the hard cap (HTTP 413 payload_too_large_xl_cap, detail includes words — the actual word count — and parts_hint — the suggested number of parts to split into). Required when file_format='text' (default). Omit when providing file_content_b64 for binary uploads.

file_content_b64string nullable

Base64-encoded bytes of a binary document file. Required when file_format is one of: 'pdf', 'docx', 'pptx', 'xlsx', 'csv', 'html', 'rtf', 'odt'. The raw byte length (after decoding) is subject to the tenant's file_size_cap_mb limit. CSV and HTML files must be sent via this field (not 'content') so the server can handle RU cp1251 encoding correctly.

file_format'pdf' | 'docx' | 'text' | 'pptx' | 'xlsx' | 'csv' | 'html' | 'rtf' | 'odt'

'text' (default) — send content as plain UTF-8 string. 'pdf' — base64 PDF, extracted via pypdf. 'docx' — base64 DOCX, extracted via python-docx. 'pptx' — base64 PPTX, extracted via python-pptx. 'xlsx' — base64 XLSX, extracted via openpyxl. 'csv' — base64 CSV bytes, decoded server-side (UTF-8 / cp1251). 'html' — base64 HTML bytes, decoded and stripped server-side. 'rtf' — base64 RTF, extracted via striprtf. 'odt' — base64 ODT, extracted via zip+lxml (no odfpy).

metadataobject

Arbitrary key-value metadata stored alongside the document.

document_datestring nullable

Optional human-readable validity date. Accepted formats: ISO date ('2024-12-15'), quarter ('2024-Q3'), year ('2024'), or any label ≤32 characters. Stored as-is; not parsed or validated as a date.

Response

Successful Response

document_idstring required
statusstring required
status_urlstring required
is_splitboolean

Changes

No recorded changes to this operation across all 1 revision of this API.