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

# Get a batch

> Read a batch's progress by item status.



## OpenAPI

````yaml GET /v1/batches/{id}
openapi: 3.1.0
info:
  title: querying.ai
  description: >-
    One API for every AI answer engine. Every task is asynchronous: submit, then
    collect the result via webhook or polling.
  version: 1.0.0
servers:
  - url: https://api.querying.ai
    description: Production
security:
  - bearerAuth: []
paths:
  /v1/batches/{id}:
    get:
      tags:
        - Tasks
      summary: Get a batch
      description: >-
        Progress of a batch: item counts by status. Polling also moves pending
        items into the queue when there is room, so a client that polls every
        few seconds keeps its batch flowing.
      operationId: getBatch
      parameters:
        - name: id
          in: path
          required: true
          description: The batch id returned by POST /v1/batches.
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: The batch.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BatchResponse'
              example:
                success: true
                batch:
                  id: 3f6b2a10-0000-0000-0000-000000000000
                  status: COMPLETED
                  total: 10000
                  counts:
                    pending: 0
                    queued: 0
                    processing: 0
                    completed: 9987
                    failed: 11
                    rejected: 2
                  createdAt: '2026-10-09T09:00:00.000Z'
                  completedAt: '2026-10-09T09:41:12.000Z'
                  idempotencyKey: daily-2026-10-09
                  webhook:
                    url: https://example.com/hooks/querying
                  metadata:
                    run: daily
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          description: No batch with this id belongs to your account.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                success: false
                error:
                  code: RESOURCE_NOT_FOUND
                  message: Batch not found
                  timestamp: '2026-10-09T09:00:00.000Z'
components:
  schemas:
    BatchResponse:
      type: object
      required:
        - success
        - batch
      properties:
        success:
          type: boolean
          const: true
        batch:
          $ref: '#/components/schemas/Batch'
    ErrorResponse:
      type: object
      required:
        - success
        - error
      properties:
        success:
          type: boolean
          const: false
        error:
          $ref: '#/components/schemas/ErrorDetail'
    Batch:
      type: object
      required:
        - id
        - status
        - total
        - counts
        - createdAt
        - completedAt
        - metadata
      properties:
        id:
          type: string
          format: uuid
        status:
          type: string
          enum:
            - OPEN
            - COMPLETED
          description: '`COMPLETED` once no item is pending, queued or processing.'
        total:
          type: integer
        counts:
          $ref: '#/components/schemas/BatchCounts'
        createdAt:
          type: string
          format: date-time
        completedAt:
          type:
            - string
            - 'null'
          format: date-time
        idempotencyKey:
          type: string
        webhook:
          type: object
          properties:
            url:
              type: string
        metadata:
          type:
            - object
            - 'null'
    ErrorDetail:
      type: object
      required:
        - code
        - message
      properties:
        code:
          type: string
          description: Stable, safe to branch on. See the Errors guide for the full list.
        message:
          type: string
          description: For humans. May change.
        details:
          description: >-
            Context for the error. An array of `{field, message}` on most
            `VALIDATION_ERROR`s; an object elsewhere (for example `{id}` on
            `RESOURCE_NOT_FOUND`, `retryAfterSec` on 429 and 503 codes). Omitted
            when there is nothing to add.
          oneOf:
            - type: array
              items:
                type: object
                properties:
                  field:
                    type: string
                  message:
                    type: string
            - type: object
              additionalProperties: true
        timestamp:
          type: string
          format: date-time
    BatchCounts:
      type: object
      required:
        - pending
        - queued
        - processing
        - completed
        - failed
        - rejected
      description: >-
        Items by status. `pending` items wait for room in your plan's
        active-task limit and in the engine's queue; `rejected` items were
        refused when their task was created (for example
        `INSUFFICIENT_CREDITS`).
      properties:
        pending:
          type: integer
        queued:
          type: integer
        processing:
          type: integer
        completed:
          type: integer
        failed:
          type: integer
        rejected:
          type: integer
  responses:
    Unauthorized:
      description: Missing or invalid bearer token.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            success: false
            error:
              code: MISSING_API_KEY
              message: Missing or invalid API key
              timestamp: '2026-07-09T04:12:00.000Z'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: 'Your API key, sent as `Authorization: Bearer <key>`.'

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.