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

# List Batch Jobs

> Retrieves all batch jobs for a business with pagination.



## OpenAPI

````yaml GET /api/batches
openapi: 3.0.0
info:
  title: Reach API
  version: 1.0.0
  description: API documentation for Reach platform
servers:
  - url: https://api.embedreach.com
    description: Production server
security: []
paths:
  /api/batches:
    get:
      tags:
        - Batch Operations
      summary: List Batch Jobs
      description: Retrieves all batch jobs for a business with pagination.
      parameters:
        - name: reach-tenant-id
          in: header
          required: false
          schema:
            type: string
            description: >-
              If using a platform scoped JWT, you can pass in a header to
              impersonate a specific tenant to impersonate the request as.
        - schema:
            type: string
            description: Pagination cursor
          required: false
          description: Pagination cursor
          name: cursor
          in: query
        - schema:
            type: string
            nullable: true
            description: 'Number of results per page (Default: 20)'
          required: false
          description: 'Number of results per page (Default: 20)'
          name: limit
          in: query
        - schema:
            type: string
            enum:
              - PARTNER_RESOURCE_JSON_INGEST
              - PARTNER_RESOURCE_BATCH_DELETE
              - PARTNER_RESOURCE_BATCH_PATCH
            description: >-
              Optional batch type to filter by. If not provided, returns all
              batch types.
          required: false
          description: >-
            Optional batch type to filter by. If not provided, returns all batch
            types.
          name: batchType
          in: query
        - schema:
            type: string
            enum:
              - createdAt
              - startedAt
              - completedAt
            description: Optional field to sort by. Defaults to createdAt.
          required: false
          description: Optional field to sort by. Defaults to createdAt.
          name: sortBy
          in: query
        - schema:
            type: string
            enum:
              - asc
              - desc
            description: Optional sort direction. Defaults to desc.
          required: false
          description: Optional sort direction. Defaults to desc.
          name: sortDirection
          in: query
        - schema:
            type: string
            enum:
              - 'true'
              - 'false'
            description: >-
              Whether to include detailed information about pending resources
              and their dependencies
          required: false
          description: >-
            Whether to include detailed information about pending resources and
            their dependencies
          name: includePendingDetails
          in: query
        - schema:
            type: string
            enum:
              - 'true'
              - 'false'
            description: >-
              Whether to only return batches that have pending resources
              (filters by pendingRecords > 0)
          required: false
          description: >-
            Whether to only return batches that have pending resources (filters
            by pendingRecords > 0)
          name: onlyBatchesWithPendingResources
          in: query
      responses:
        '200':
          description: Status 200 response
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  message:
                    type: string
                  data:
                    type: object
                    properties:
                      results:
                        type: array
                        items:
                          type: object
                          properties:
                            batchId:
                              type: string
                              description: The ID of the batch operation
                            status:
                              type: string
                              enum:
                                - success
                                - partial_success
                                - failure
                                - processing
                              description: The current status of the batch operation
                            batchType:
                              type: string
                              enum:
                                - PARTNER_RESOURCE_JSON_INGEST
                                - PARTNER_RESOURCE_BATCH_DELETE
                                - PARTNER_RESOURCE_BATCH_PATCH
                              description: The type of batch operation
                            progress:
                              type: object
                              properties:
                                totalRecords:
                                  type: number
                                  description: Total number of records in the batch
                                processedRecords:
                                  type: number
                                  description: Number of records processed so far
                                successfulRecords:
                                  type: number
                                  description: Number of records processed successfully
                                pendingRecords:
                                  type: number
                                  description: >-
                                    Number of records stored as pending due to
                                    missing dependencies
                                failedRecords:
                                  type: number
                                  description: Number of records that failed processing
                                successRate:
                                  type: number
                                  description: Percentage of successful records (0-100)
                              description: Detailed progress information
                            completedAt:
                              type: string
                              description: Timestamp when the batch completed processing
                            startedAt:
                              type: string
                              description: Timestamp when the batch started processing
                            createdAt:
                              type: string
                              description: Timestamp when the batch was created
                            schemaName:
                              type: string
                              description: >-
                                The name of the schema definition used for this
                                batch
                            schemaDefinitionId:
                              type: string
                              description: >-
                                The ID of the schema definition used for this
                                batch
                            errors:
                              type: object
                              properties:
                                summary:
                                  type: object
                                  additionalProperties:
                                    type: number
                                  description: Summary of error categories and counts
                                details:
                                  type: object
                                  additionalProperties:
                                    type: object
                                    properties:
                                      errors:
                                        type: array
                                        items:
                                          type: string
                                      categories:
                                        type: array
                                        items:
                                          type: string
                                    required:
                                      - errors
                                      - categories
                                  description: >-
                                    Detailed errors organized by record external
                                    ID
                                message:
                                  type: string
                                  description: >-
                                    General error message if the entire batch
                                    failed
                              description: Error information if there were any issues
                            pendingResources:
                              type: array
                              items:
                                type: object
                                properties:
                                  id:
                                    type: string
                                    description: The ID of the pending resource
                                  resourceExternalId:
                                    type: string
                                    description: >-
                                      The external ID of the resource that is
                                      pending
                                  schemaDefinitionId:
                                    type: string
                                    description: The schema definition ID for this resource
                                  schemaName:
                                    type: string
                                    description: >-
                                      The schema definition name for this
                                      resource
                                  missingDependencies:
                                    type: array
                                    items:
                                      type: object
                                      properties:
                                        schemaDefinitionId:
                                          type: string
                                          description: >-
                                            The schema definition ID of the missing
                                            dependency
                                        schemaName:
                                          type: string
                                          description: >-
                                            The schema definition name of the
                                            missing dependency
                                        externalId:
                                          type: string
                                          description: >-
                                            The external ID of the missing
                                            dependency
                                      required:
                                        - schemaDefinitionId
                                        - externalId
                                    description: >-
                                      List of dependencies this resource is
                                      waiting for
                                  expiresAt:
                                    type: string
                                    description: >-
                                      When this pending resource will expire if
                                      dependencies are not resolved
                                  createdAt:
                                    type: string
                                    description: When the resource was stored as pending
                                required:
                                  - id
                                  - resourceExternalId
                                  - schemaDefinitionId
                                  - missingDependencies
                                  - expiresAt
                                  - createdAt
                              description: >-
                                Detailed information about resources stored as
                                pending (only included if includePendingDetails
                                query parameter is set)
                          required:
                            - batchId
                            - status
                            - batchType
                            - progress
                      pagination:
                        type: object
                        properties:
                          hasNextPage:
                            type: boolean
                          cursor:
                            type: string
                            nullable: true
                          total:
                            type: number
                        required:
                          - hasNextPage
                    required:
                      - results
                      - pagination
                required:
                  - success
        '400':
          description: Bad Request - Validation or request error
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                    default: false
                  message:
                    type: string
                    description: Error message describing what went wrong
                  errors:
                    type: array
                    items:
                      type: string
                    description: Optional array of specific validation errors
                required:
                  - message

````