Documents

Get the OCR-converted markdown of a document

Changed on

Returns the full markdown representation produced by OCR for the document. Equivalent to passing include_markdown=true on /v1/extract, but callable at any time after OCR has completed. Useful for PDF-to-markdown conversion without requiring a schema or re-running extraction.

Returns 404 if the document does not exist, is still being processed, or is an image that did not produce OCR output.

A document ingested by /v1/run under a Spec whose Source stage sets markdown_policy: on_demand is stored without OCR. The first call to this endpoint starts its OCR and waits a short, bounded time for it: 200 with the markdown when it finishes in time, otherwise 202 with a Retry-After header (seconds); call again after that delay.

get/v1/documents/{id}/markdown

Request

  • Base URL
    https://api.talonic.com
  • Auth
    HTTP bearer

Path parameters

id, string uuid required
Example:a1b2c3d4-e5f6-7890-abcd-ef1234567890

Resource UUID.

Response

Document markdown.

object required
document_id, string uuid required

ID of the document the markdown was produced from.

markdown, string required

Full OCR-converted markdown body.

Example response

{
  "document_id": "f0e1d2c3-b4a5-9687-8765-432109876543",
  "markdown": "# Invoice INV-2024-0042\nVendor: Acme Corp..."
}

Changes