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

# Move to another batch

> Move a document to another batch and re-extract.

Re-files the document into a batch you can edit, then re-extracts. Always billable, attributed to the mover. Same-schema moves keep cell overrides; a different schema clears them.

**409** if the document is still processing. **400** if the destination is a schema-builder test batch. **409** if the destination is canceled.


## OpenAPI

````yaml POST /api/v2/documents/attachments/{att_id}/move-batch/
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}/move-batch/:
    post:
      tags:
        - v2/documents
      summary: Move a document to a different batch
      description: >-
        Reassigns the document (identified by its attachment) out of its current
        batch and into ``target_batch_id`` (master task 11). Purges the stale ES
        chunks + extraction state, clears cell overrides when the target struct
        differs, and enqueues a fresh billable re-extraction under the target's
        schema attributed to the caller (Decision 15). The caller must be able
        to EDIT both the source and target batch. A document mid-extraction is
        409; a schema-test target is 400; a cancelled target is 409; moving to
        the current batch is an accepted no-op. Also the WS3 review-queue
        reassign backend.
      operationId: v2_documents_attachments_move_batch_create
      parameters:
        - in: path
          name: att_id
          schema:
            type: integer
          required: true
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MoveBatchRequestRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MoveBatchResponse'
          description: ''
        '400':
          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:
    MoveBatchRequestRequest:
      type: object
      description: >-
        Body for POST ``/attachments/<att_id>/move-batch/``.


        ``target_batch_id``: the batch to move the document into. Must be a
        batch the

        caller can edit (403 otherwise) that isn't a schema-test or cancelled
        batch

        (400/409). Moving to the document's current batch is an accepted no-op.
      properties:
        target_batch_id:
          type: integer
      required:
        - target_batch_id
    MoveBatchResponse:
      type: object
      description: Response for the move-batch POST — mirrors ``batch_moves.MoveResult``.
      properties:
        code:
          type: string
        moved:
          type: boolean
        source_batch_id:
          type:
            - integer
            - 'null'
        target_batch_id:
          type:
            - integer
            - 'null'
        cleared_overrides:
          type: boolean
        purged_lynx_document_id:
          type:
            - string
            - 'null'
      required:
        - cleared_overrides
        - code
        - moved
        - purged_lynx_document_id
        - source_batch_id
        - target_batch_id
  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.

````