Skip to main content
GET
Get document
{id} is the Deep Reader chat pk. For the attachment-id surface use Get a document.

Authorizations

Authorization
string
header
required

Organisation API key from Settings → API / /api/keys/. The secret is shown once. Send Authorization: Bearer sk-abacus-…. One active key per organisation. Ingest (/api/v2/ingest/*) refuses API keys — that surface is Auth0-only with ingest:read / ingest:write scopes.

Path Parameters

id
integer
required

Response

Full document projection for the document viewer.

Extends DocumentListItemSerializer with content + extraction fields, and the schema-versioning + override surface introduced by the schema-versioning, editable-batch-grid, and per-field-translation tracks.

Optional fields (markdown_content, extraction_result) are included only when non-empty/non-null to keep the payload lean. The legacy extraction_schema_json JSONField was dropped from ChatAttachment by documents/0017_struct_versioning_backfill_and_drops and replaced by the extraction_struct_version FK; SPA reads extraction_struct (below) to get the (slug, version_number, schema_url) triple it needs to navigate to the schema authoring UI.

id
integer
required
read-only
created_at
string<date-time>
required
read-only
status
string
required
read-only
progress
integer
required
read-only
stage
string
required
read-only
page_count
integer
required
read-only
file_type
string
required
read-only
file_name
string
required
read-only
completed_at
string | null
required
read-only
summary
string | null
required
read-only
has_extraction
boolean
required
read-only
has_translation
boolean
required
read-only
has_overrides
boolean
required
read-only

True iff the doc has any user-edited cells (AD-164 editable batch grid).

Surfaces an "edited" badge in the SPA list view so users can spot which docs have human corrections without opening the detail page.

has_warnings
boolean
required
read-only

True iff the doc has any per-page processing warnings from Lynx (AD-147).

Surfaces a warning icon in the SPA list view; SPA can navigate to the viewer to see per-page detail.

snippet
string | null
required
read-only
score
number<double> | null
required
read-only
markdown_content
string | null
required
read-only
translated_versions
object
required
read-only
lynx_document_id
string | null
required
read-only
lynx_chunk_count
integer
required
read-only
extraction_result
any
required
extraction_struct
object | null
required
read-only

Return the (slug, version_number, schema_url) triple for the StructVersion that produced this extraction.

Replaces the legacy extraction_schema_json field (dropped in documents/0017). SPA uses this to:

  • link to the schema authoring page (/structs/<slug>/edit/)
  • fetch the immutable published schema JSON via /api/v2/structs/<slug>/versions/<n>/ (already exposed by the structs sub-namespace, see deckmonkey/api_v2/structs/urls.py)
  • show "extracted using v" badges in the document viewer

Returns None when the document was processed without a schema (free transcription) or when the version reference was orphaned by hard delete (defensive).

processing_warnings
object[]
required
read-only

Return per-page Lynx OCR warnings for this document (AD-147).

Each entry shaped like {page, code, message, severity}. Empty list when the document processed cleanly. SPA renders these inline in the viewer to flag pages where OCR self-recovery had to fall back.

overrides_count
integer
required
read-only

Number of fields with at least one user-edit override (AD-164).

Counts the dict keys in extraction_overrides regardless of which side (original / translated) was edited. SPA shows this as a small badge on the document detail header.

has_translated_overrides
boolean
required
read-only

True iff at least one override entry has a translated_value slot populated (AD-164 per-side editing).

Distinct from has_overrides (any side) — useful for SPA to know whether translation edits exist before deciding whether to surface the translated/original toggle on the document viewer.

title
string
Maximum string length: 255