> ## Documentation Index
> Fetch the complete documentation index at: https://help.abacusdocs.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Get a document

> Full ChatAttachment projection for the unified viewer.

Full projection for the unified viewer: file metadata, processing status, transcription, extraction result and overrides, quality verdict.

`att_id` is the attachment id from the list route. A missing or cross-tenant id is **404**.


## OpenAPI

````yaml GET /api/v2/documents/attachments/{att_id}/
openapi: 3.1.0
info:
  title: Abacus Docs API
  version: 1.0.0
  description: |
    REST + SSE surface for Abacus Docs on the same host as the web app
    (`https://abacusdocs.com`). Paths are `/api/v2/…`.

    Authenticate with an organisation API key (`sk-abacus-*`) as a Bearer
    token, or an Auth0 access token. Cross-tenant reads return **404**, not
    403. Page-based lists use `?page=` and `?page_size=`.

    Extraction, reprocess, schema tests, and chat turns spend credits.
    See the help centre Credits pages for rates.
  contact:
    name: Abacus Docs
    url: https://abacusdocs.com/contact
servers:
  - url: https://abacusdocs.com
    description: Production (Extract)
security: []
paths:
  /api/v2/documents/attachments/{att_id}/:
    get:
      tags:
        - v2/documents
      summary: Get a document (full projection)
      description: >-
        Full document data: content, extraction, overrides, translations,
        warnings, schema.
      operationId: v2_documents_attachments_retrieve
      parameters:
        - in: path
          name: att_id
          schema:
            type: integer
          required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AttachmentDocumentDetail'
          description: ''
        '404':
          content:
            application/json:
              schema:
                type: object
                additionalProperties: {}
          description: ''
      security:
        - extractApiKey: []
        - bearerAuth: []
        - cookieAuth: []
components:
  schemas:
    AttachmentDocumentDetail:
      type: object
      description: >-
        Full projection of a ``ChatAttachment`` for the unified document view.


        Extends the list item with the heavy content + extraction surface the

        document viewer (tabs: Extracted / Markdown / Translation / Warnings)

        needs in one round-trip. ``extraction_result`` +
        ``extraction_overrides``

        are returned independently so the client can render the LLM original,
        the

        user override, or both side-by-side without a follow-up call, and

        ``extraction_status`` carries the quality verdict on that extraction

        (AD-520) so a sparse or mismatched result is not indistinguishable from

        a clean one.
      properties:
        id:
          type: integer
          readOnly: true
        file_name:
          type: string
          readOnly: true
        file_type:
          type: string
          readOnly: true
        processing_status:
          allOf:
            - $ref: '#/components/schemas/ProcessingStatusEnum'
          readOnly: true
          description: |-
            Lynx processing pipeline status: pending → completed/failed

            * `pending` - Pending
            * `completed` - Completed
            * `failed` - Failed
        processing_progress:
          type: integer
          readOnly: true
          description: Processing completion percentage 0-100
        processing_stage:
          type: string
          readOnly: true
          description: >-
            Current processing stage name, or the failure reason on a FAILED
            attachment
        page_count:
          type: integer
          readOnly: true
          description: Number of pages in the original document
        has_schema:
          type: boolean
          description: True when a schema (StructVersion) is pinned for extraction.
          readOnly: true
        extraction_struct_version_id:
          type:
            - integer
            - 'null'
          description: >-
            StructVersion that produced this attachment's extraction_result.
            NULL for non-batch attachments or pre-versioning records.
          readOnly: true
        target_language:
          type: string
          readOnly: true
          description: ISO language code for translation target (e.g. 'en', 'ar')
        is_from_kb:
          type: boolean
          readOnly: true
          description: Whether this attachment came from Knowledge Base
        kb_file_id:
          type:
            - integer
            - 'null'
          readOnly: true
          description: Original Knowledge Base file ID if from KB
        lynx_document_id:
          type:
            - string
            - 'null'
          readOnly: true
          description: Lynx document ID after processing (extraction + chunking + indexing)
        document_summary:
          type:
            - string
            - 'null'
          readOnly: true
          description: Cached document summary from Lynx processing
        has_extraction:
          type: boolean
          description: True when schema-guided extraction produced a result.
          readOnly: true
        has_translation:
          type: boolean
          description: True when at least one translated version exists.
          readOnly: true
        has_warnings:
          type: boolean
          description: True when Lynx emitted any processing warnings.
          readOnly: true
        home_chat_id:
          type: integer
          readOnly: true
        created_at:
          type: string
          format: date-time
          readOnly: true
        completed_at:
          type:
            - string
            - 'null'
          format: date-time
          readOnly: true
          description: When Lynx processing finished (set on COMPLETED/FAILED transitions).
        markdown_content:
          type: string
          readOnly: true
        translated_versions:
          type: object
          additionalProperties: {}
          description: Translated versions keyed by language, minus internal Lynx ids.
          readOnly: true
        extraction_result:
          readOnly: true
        extraction_status:
          type:
            - string
            - 'null'
          description: >-
            Quality verdict on the extraction, independent of
            ``processing_status``.


            ``success`` / ``partial`` / ``schema_mismatch`` / ``ocr_failed``, or

            ``None`` when no extraction has run. AD-520: ``processing_status``

            answers "did the pipeline finish", this answers "is the extraction
            any

            good" — a refused verdict is ``processing_status="failed"`` with
            every

            field the engine DID recover still present in ``extraction_result``,

            and the human-readable reason on ``processing_stage``. Same
            vocabulary

            the batch grid publishes, so the two document surfaces describe one

            document identically.


            Reads the pinned ``StructVersion`` — the detail view

            ``select_related``s it, so this costs no extra query.
          readOnly: true
        extraction_overrides:
          type: object
          additionalProperties: {}
          description: The raw per-field override map (empty dict when none).
          readOnly: true
        extraction_struct:
          type:
            - object
            - 'null'
          additionalProperties: {}
          description: >-
            The (slug, version, schema_url) triple for the producing
            StructVersion.


            Returns ``None`` when the doc was processed without a schema (free

            transcription) or the version reference was orphaned by hard delete.

            Mirrors
            ``serializers.DocumentDetailSerializer.get_extraction_struct``

            so both document surfaces emit the same schema-navigation shape.
          readOnly: true
        processing_warnings:
          type: array
          items:
            type: object
            additionalProperties: {}
          description: Per-page Lynx warnings; empty list when the doc processed cleanly.
          readOnly: true
        lynx_chunk_count:
          type: integer
          readOnly: true
      required:
        - completed_at
        - created_at
        - document_summary
        - extraction_overrides
        - extraction_result
        - extraction_status
        - extraction_struct
        - extraction_struct_version_id
        - file_name
        - file_type
        - has_extraction
        - has_schema
        - has_translation
        - has_warnings
        - home_chat_id
        - id
        - is_from_kb
        - kb_file_id
        - lynx_chunk_count
        - lynx_document_id
        - markdown_content
        - page_count
        - processing_progress
        - processing_stage
        - processing_status
        - processing_warnings
        - target_language
        - translated_versions
    ProcessingStatusEnum:
      enum:
        - pending
        - completed
        - failed
      type: string
      description: |-
        * `pending` - Pending
        * `completed` - Completed
        * `failed` - Failed
  securitySchemes:
    extractApiKey:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: |
        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.
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >
        Auth0 access token for a signed-in user. Send `Authorization: Bearer
        <token>`.

        The SPA and desktop agent use this. Prefer an organisation API key for

        server-to-server integrations.
    cookieAuth:
      type: apiKey
      in: cookie
      name: sessionid
      description: |
        Django session cookie from a browser login. Present so the web app can
        call `/api/v2` without a header. Do not rely on this for integrations.

````