> ## 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.

# Upload documents (chat id)

> Upload into a Deep Reader chat.

Uploads into a Deep Reader chat. Completing extraction is a single-document page charge. PDF and images only; 64 MB; up to 20 files.


## OpenAPI

````yaml POST /api/v2/documents/
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/:
    post:
      tags:
        - v2/documents
      summary: Upload documents
      description: >-
        Upload one or more PDF or image files for processing. Images are
        combined into a single PDF. Returns 402 when the organisation has
        insufficient credits. Processing happens asynchronously; poll
        `/progress/` for status.
      operationId: v2_documents_create
      requestBody:
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                files:
                  type: array
                  items:
                    type: string
                    format: binary
                target_language:
                  type: string
              required:
                - files
      responses:
        '202':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UploadResponse'
          description: ''
        '400':
          description: No response body
        '402':
          description: No response body
      security:
        - extractApiKey: []
        - bearerAuth: []
        - cookieAuth: []
components:
  schemas:
    UploadResponse:
      type: object
      description: Response from POST /api/v2/documents/.
      properties:
        documents:
          type: array
          items:
            $ref: '#/components/schemas/DocumentListItem'
        skipped:
          type: array
          items:
            $ref: '#/components/schemas/SkippedFile'
      required:
        - documents
        - skipped
    DocumentListItem:
      type: object
      description: >-
        Minimal document projection for library grid cards.


        Combines Chat fields (id, title, created_at) with ChatAttachment
        processing

        state. Views must call prefetch_related('attachments') to avoid N+1
        queries.


        When the view performs a Lynx BM25 search, it passes ``snippets`` and

        ``scores`` dicts (keyed by Chat pk) via serializer context so each item

        gets the matching excerpt and relevance score.
      properties:
        id:
          type: integer
          readOnly: true
        title:
          type: string
          maxLength: 255
        created_at:
          type: string
          format: date-time
          readOnly: true
        status:
          type: string
          readOnly: true
        progress:
          type: integer
          readOnly: true
        stage:
          type: string
          readOnly: true
        page_count:
          type: integer
          readOnly: true
        file_type:
          type: string
          readOnly: true
        file_name:
          type: string
          readOnly: true
        completed_at:
          type:
            - string
            - 'null'
          readOnly: true
        summary:
          type:
            - string
            - 'null'
          readOnly: true
        has_extraction:
          type: boolean
          readOnly: true
        has_translation:
          type: boolean
          readOnly: true
        has_overrides:
          type: boolean
          description: >-
            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.
          readOnly: true
        has_warnings:
          type: boolean
          description: >-
            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.
          readOnly: true
        snippet:
          type:
            - string
            - 'null'
          readOnly: true
        score:
          type:
            - number
            - 'null'
          format: double
          readOnly: true
      required:
        - completed_at
        - created_at
        - file_name
        - file_type
        - has_extraction
        - has_overrides
        - has_translation
        - has_warnings
        - id
        - page_count
        - progress
        - score
        - snippet
        - stage
        - status
        - summary
    SkippedFile:
      type: object
      description: A file the upload endpoint could not process.
      properties:
        file_name:
          type: string
        reason:
          type: string
      required:
        - file_name
        - reason
  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.

````