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

# List attached batches

> List batches attached to an Extract chat.

Batches already attached as chat context. Attach more with the POST sibling.


## OpenAPI

````yaml GET /api/v2/chats/{thread_id}/batch-attachments/
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/chats/{thread_id}/batch-attachments/:
    get:
      tags:
        - v2/chats
      summary: List batch attachments for a chat
      description: >-
        Returns the chat's currently attached batches in newest-first order.
        Each entry surfaces the batch name + status so the SPA can render the
        'Attached batches' panel without a follow-up /api/v2/batches/ lookup.
      operationId: v2_chats_batch_attachments_list
      parameters:
        - in: path
          name: thread_id
          schema:
            type: string
          required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ChatBatchAttachment'
          description: ''
        '404':
          content:
            application/json:
              schema:
                type: object
                additionalProperties: {}
          description: ''
      security:
        - extractApiKey: []
        - bearerAuth: []
        - cookieAuth: []
components:
  schemas:
    ChatBatchAttachment:
      type: object
      description: |-
        Response shape for chat <-> batch attachment endpoints.

        Surfaces enough metadata for the SPA's "Attached batches" panel to
        render without a follow-up ``/api/v2/batches/`` lookup:
        ``batch_name``, ``batch_status``, the attaching user's email, and
        the render mode.

        The model docstring on ``ChatBatchAttachment`` documents the unlink
        semantics -- the join row CASCADE-deletes with chat or batch but
        never deletes the chat/batch itself, so this serializer's view of
        ``batch`` is always live.
      properties:
        id:
          type: integer
          readOnly: true
        batch_id:
          type: integer
          readOnly: true
        batch_name:
          type: string
          readOnly: true
        batch_status:
          type: string
          readOnly: true
        attached_at:
          type: string
          format: date-time
          readOnly: true
        attached_by_email:
          type:
            - string
            - 'null'
          description: |-
            Surface the attaching user's email or ``None`` if user was deleted.

            ``attached_by`` is ``SET_NULL`` on user delete -- we keep the join
            row alive even after the user is gone, so this returns ``None``
            when the attacher account no longer exists.
          readOnly: true
        context_mode:
          type: string
          readOnly: true
          description: >-
            Render mode for BatchExtractionProvider. 'full' renders the entire
            grid (batches over the size limit still downshift to summary);
            'summary' renders schema + a small sample + a query_batch_data SQL
            pointer; 'schema_only' renders schema + pointer with no rows.
      required:
        - attached_at
        - attached_by_email
        - batch_id
        - batch_name
        - batch_status
        - context_mode
        - 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.

````