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

# Get Batch

> Get the current status and results of a batch processing request.

Returns progress information (`total_items`, `completed_items`, `failed_items`), individual item results with their extracted data, and any failed webhook deliveries for debugging.



## OpenAPI

````yaml /api-reference/openapi.json get /v3/batches/{batch_id}
openapi: 3.1.0
info:
  title: matil API
  description: Structured data extraction for documents
  version: 3.0.0
servers:
  - url: https://api.matil.ai
security:
  - ApiKeyAuth: []
paths:
  /v3/batches/{batch_id}:
    get:
      tags:
        - Batches
      summary: Get Batch
      description: >-
        Get the current status and results of a batch processing request.


        Returns progress information (`total_items`, `completed_items`,
        `failed_items`), individual item results with their extracted data, and
        any failed webhook deliveries for debugging.
      operationId: get_batch_v3_batches__batch_id__get
      parameters:
        - name: batch_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Batch Id
        - name: authorization
          in: header
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Authorization
        - name: x-api-key
          in: header
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: X-Api-Key
        - name: X-Tenant-ID
          in: header
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: X-Tenant-Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BatchStatusResponse'
        '401':
          description: >-
            Authentication required. Provide a valid `x-api-key` or
            `Authorization: Bearer` token.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error: AUTHENTICATION_REQUIRED
                message: Authentication required. Provide a valid x-api-key header.
                details: null
        '403':
          description: Access denied to this batch.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error: ACCESS_DENIED
                message: Access denied to this batch.
                details: null
        '404':
          description: Batch not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error: BATCH_NOT_FOUND
                message: Batch not found.
                details: null
components:
  schemas:
    BatchStatusResponse:
      properties:
        batch_id:
          type: string
          format: uuid
          title: Batch Id
          description: ID of the batch
        status:
          type: string
          title: Status
          description: Current status of the batch
        total_items:
          type: integer
          title: Total Items
          description: Total number of items in the batch
        completed_items:
          type: integer
          title: Completed Items
          description: Number of completed items
        failed_items:
          type: integer
          title: Failed Items
          description: Number of failed items
        resource_type:
          type: string
          title: Resource Type
          description: Resource type used for processing
          default: structure
        resource_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Resource Id
          description: Structure ID used for processing
        resource_version_number:
          anyOf:
            - type: integer
            - type: 'null'
          title: Resource Version Number
          description: Structure version number used
        created_at:
          type: string
          format: date-time
          title: Created At
          description: When the batch was created
        completed_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Completed At
          description: When the batch completed
        items:
          items:
            $ref: '#/components/schemas/BatchItemStatus'
          type: array
          title: Items
          description: List of batch items with their processing status and results
        failed_webhooks:
          items:
            $ref: '#/components/schemas/WebhookDeliveryInfo'
          type: array
          title: Failed Webhooks
          description: Failed webhook deliveries (for debugging)
      type: object
      required:
        - batch_id
        - status
        - total_items
        - completed_items
        - failed_items
        - created_at
      title: BatchStatusResponse
      description: Response for batch status query.
    ErrorResponse:
      type: object
      properties:
        error:
          type: string
          description: Machine-readable error code.
        message:
          type: string
          description: Human-readable description.
        details:
          type: object
          nullable: true
          description: Additional context when available.
      required:
        - error
        - message
    BatchItemStatus:
      properties:
        metadata:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Metadata
          description: Client-provided metadata (echoed back)
        status:
          type: string
          title: Status
          description: 'Processing status: completed | failed | pending'
        entry_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Entry Id
          description: Created entry ID
        data:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Data
          description: Extracted data if successful
        errors:
          anyOf:
            - items:
                additionalProperties: true
                type: object
              type: array
            - type: 'null'
          title: Errors
          description: Validation errors if any
      type: object
      required:
        - status
      title: BatchItemStatus
      description: Status of a single batch item.
    WebhookDeliveryInfo:
      properties:
        webhook_id:
          type: string
          title: Webhook Id
          description: Unique webhook ID for idempotency
        event:
          type: string
          title: Event
          description: 'Event type: batch.item.completed, batch.completed, batch.failed'
        status:
          type: string
          title: Status
          description: 'Delivery status: pending, delivered, failed'
        http_status:
          anyOf:
            - type: integer
            - type: 'null'
          title: Http Status
          description: HTTP response status code
        error_message:
          anyOf:
            - type: string
            - type: 'null'
          title: Error Message
          description: Error message if failed
        attempt_count:
          type: integer
          title: Attempt Count
          description: Number of delivery attempts made
        created_at:
          type: string
          format: date-time
          title: Created At
          description: When the webhook was created
        delivered_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Delivered At
          description: When successfully delivered
        item_metadata:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Item Metadata
          description: Item metadata for correlation (for item webhooks)
      type: object
      required:
        - webhook_id
        - event
        - status
        - attempt_count
        - created_at
      title: WebhookDeliveryInfo
      description: Info about a single webhook delivery attempt.
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key

````