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

# Resume a batch

> Resume pending and failed documents in a batch.

Re-enqueues pending and failed documents. Completed rows stay untouched. Billed at the **batch** page rate for work that actually runs.


## OpenAPI

````yaml POST /api/v2/batches/{batch_id}/resume/
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/batches/{batch_id}/resume/:
    post:
      tags:
        - v2/batches
      summary: Resume a cancelled batch
      description: >-
        AD-419: reopen a terminal ``CANCELLED`` batch by flipping its
        ``CANCELLED`` ``BatchDocument`` rows back to ``PENDING`` and
        re-enqueueing ``process_batch``. COMPLETED and FAILED docs are never
        touched (failed retry stays on the reprocess endpoint). Does **not**
        bypass lynx's per-page OCR cache — this is a resume, not a fresh
        reprocess.


        Reprocess / add-documents remain blocked while the batch is
        ``CANCELLED``; after a successful resume the batch is ``PROCESSING``
        again and those paths work as usual.
      operationId: v2_batches_resume_create
      parameters:
        - in: path
          name: batch_id
          schema:
            type: integer
          required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BatchResumeResponse'
          description: ''
        '402':
          content:
            application/json:
              schema:
                type: object
                additionalProperties: {}
          description: ''
        '403':
          content:
            application/json:
              schema:
                type: object
                additionalProperties: {}
          description: ''
        '404':
          content:
            application/json:
              schema:
                type: object
                additionalProperties: {}
          description: ''
        '409':
          content:
            application/json:
              schema:
                type: object
                additionalProperties: {}
          description: ''
      security:
        - extractApiKey: []
        - bearerAuth: []
        - cookieAuth: []
components:
  schemas:
    BatchResumeResponse:
      type: object
      description: >-
        Response shape for POST /api/v2/batches/{batch_id}/resume/ (AD-419).


        Resumes a cancelled batch by flipping CANCELLED docs back to PENDING and

        re-enqueueing ``process_batch``. COMPLETED and FAILED docs are
        untouched.


        Fields:
            batch: The updated parent batch (status flipped to PROCESSING).
            resumed_doc_count: Number of CANCELLED ``BatchDocument`` rows flipped
                back to PENDING.
            estimated_credit_cost: Best-effort millicredit estimate for the
                remaining cancelled docs (informational; actual deduction happens
                inside ``process_batch``).
      properties:
        batch:
          $ref: '#/components/schemas/BatchSummary'
        resumed_doc_count:
          type: integer
        estimated_credit_cost:
          type: integer
          description: >-
            Estimated millicredit cost across resumed cancelled docs (page_count
            * EXTRACT_MILLICREDITS_PER_PAGE). Informational.
      required:
        - batch
        - estimated_credit_cost
        - resumed_doc_count
    BatchSummary:
      type: object
      description: >-
        Compact projection of a Batch row for responses that need to echo

        the parent batch state alongside per-row payloads.


        Currently used by ``BatchReprocessResponse`` so the SPA can update its

        batch header (status pill, default version chip) without a follow-up
        GET.
      properties:
        id:
          type: integer
        name:
          type: string
        status:
          type: string
        total_files:
          type: integer
        succeeded_count:
          type: integer
        failed_count:
          type: integer
        default_version_number:
          type:
            - integer
            - 'null'
          description: >-
            Version number of Batch.default_struct_version, or null for plain
            batches.
      required:
        - default_version_number
        - failed_count
        - id
        - name
        - status
        - succeeded_count
        - total_files
  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.

````