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

# List merge batches (paginated)

> Returns a paginated list of `DuplicateMergeBatch` records for the caller's client. Each batch includes bounded donor, operator, field-name, and relationship-count summaries for admin review. Restore ledgers, field values, processor identifiers, and internal errors are never returned. Standard Laravel pagination envelope (20 per page). Requires permission: `duplicates_manage` (also satisfied by `donors_manage`).



## OpenAPI

````yaml get /admin/duplicates/merge/batches
openapi: 3.0.0
info:
  title: Gratona API
  description: >-
    REST API for the Gratona fundraising platform, including donor, donation,
    sponsorship, program, event, and integration workflows. Endpoints are
    organized by tag. Most endpoints require either a Passport bearer token or
    an issued API key — see the Security Schemes section.
  contact:
    name: Gratona Engineering
    url: https://gratona.com
    email: devs@gratona.com
  version: 1.0.0
servers:
  - url: https://api.gratona.com/v1
    description: Server Version 1.0.0
security: []
tags:
  - name: Auth
    description: >-
      Login, signup, logout, password reset, and email verification for admin
      users and donors.
  - name: Donors
    description: >-
      Donor records: CRUD, profile fields, household linkage, search, filters,
      merge, and duplicate detection.
  - name: Donations
    description: >-
      Individual donation records, recurring commitments, soft credits, refunds,
      designations, and exports.
  - name: Sponsorships
    description: >-
      Donor-to-entity sponsorship relationships, lifecycle transitions, and
      sponsorship-specific filters.
  - name: Entities
    description: >-
      Recipient records (children, families, projects, animals, etc.), their
      status, and entity-level fields.
  - name: Programs
    description: >-
      Program / campaign configuration: hierarchy, settings, and program-level
      metadata.
  - name: Forms
    description: >-
      Custom form builder (HysForm), form fields, standardized donor fields, and
      field migrations.
  - name: Trips
    description: >-
      Mission-trip management: trips, participants, budgets, tasks,
      e-signatures, fundraising milestones, and background checks.
  - name: Communications
    description: >-
      Email templates, SMS, newsletters, donor email manager, and per-donor
      notes.
  - name: Payments
    description: >-
      Payment-gateway management (Stripe, PayPal, Flutterwave, QuickBooks).
      Excludes inbound webhooks — see the Webhooks tag.
  - name: Reports
    description: Dashboards, analytics, scheduled reports, and exports.
  - name: Admin
    description: >-
      Client-account administration: users, groups/permissions, settings,
      integrations, and account lifecycle.
  - name: Donor Portal
    description: >-
      Endpoints consumed by the donor-facing portal (donor login, dashboard,
      donation history, messages).
  - name: Recipient Portal
    description: Endpoints consumed by the recipient-facing portal.
  - name: Public
    description: >-
      Unauthenticated public endpoints: donor signup, public trip pages,
      peer-to-peer campaigns, public checkout.
  - name: Webhooks
    description: >-
      Inbound webhooks from third parties (Stripe, PayPal, Flutterwave, Checkr,
      DropboxSign). Annotated minimally for reference; payload shapes are owned
      by the upstream provider.
  - name: Client
    description: Client
  - name: Email Settings
    description: Email Settings
  - name: Admin Dashboard
    description: Admin Dashboard
  - name: Historical Archived Updates
    description: Historical Archived Updates
  - name: Team & access
    description: Team & access
  - name: Files
    description: Files
  - name: Wrapped
    description: Wrapped
  - name: Donor SignUp
    description: Donor SignUp
  - name: Frontend
    description: Frontend
  - name: User
    description: User
paths:
  /admin/duplicates/merge/batches:
    get:
      tags:
        - Donors
      summary: List merge batches (paginated)
      description: >-
        Returns a paginated list of `DuplicateMergeBatch` records for the
        caller's client. Each batch includes bounded donor, operator,
        field-name, and relationship-count summaries for admin review. Restore
        ledgers, field values, processor identifiers, and internal errors are
        never returned. Standard Laravel pagination envelope (20 per page).
        Requires permission: `duplicates_manage` (also satisfied by
        `donors_manage`).
      operationId: 9664a0651f804dd091e0d66845201d81
      parameters:
        - name: hysform_id
          in: query
          description: Restrict to one donor form.
          required: false
          schema:
            type: integer
          example: 42
        - name: search
          in: query
          description: >-
            Search batch reference, status, operator, or donor identity before
            pagination.
          required: false
          schema:
            type: string
            maxLength: 120
        - name: status
          in: query
          description: Restrict history to one batch status.
          required: false
          schema:
            type: string
            enum:
              - completed
              - undone
              - failed
              - processing
              - pending
        - name: date
          in: query
          description: Restrict history to the calendar day shown to the administrator.
          required: false
          schema:
            type: string
            format: date
        - name: timezone
          in: query
          description: >-
            IANA timezone used to calculate exact calendar-day boundaries,
            including daylight-saving transitions.
          required: false
          schema:
            type: string
            example: America/New_York
        - name: timezone_offset_minutes
          in: query
          description: >-
            Offset fallback for clients that do not provide an IANA timezone.
            Use the offset on the selected date.
          required: false
          schema:
            type: integer
            maximum: 840
            minimum: -840
      responses:
        '200':
          description: Paginated batches.
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/PaginatedResponse'
                  - properties:
                      data:
                        type: array
                        items:
                          properties:
                            id:
                              type: integer
                              example: 88
                            client_id:
                              type: integer
                              example: 207
                            hysform_id:
                              type: integer
                              example: 42
                            user_id:
                              type: integer
                              example: 15
                            scan_run_id:
                              type: integer
                              example: 512
                              nullable: true
                            status:
                              type: string
                              example: completed
                            total_merges:
                              type: integer
                              example: 12
                            processed_merges:
                              type: integer
                              example: 12
                            successful_merges:
                              type: integer
                              example: 12
                            failed_merges:
                              type: integer
                              example: 0
                            progress:
                              type: number
                              format: float
                              example: 100
                            started_at:
                              type: string
                              format: date-time
                              nullable: true
                            completed_at:
                              type: string
                              format: date-time
                              nullable: true
                            undone_at:
                              type: string
                              format: date-time
                              nullable: true
                            undone_by:
                              type: integer
                              nullable: true
                            created_at:
                              type: string
                              format: date-time
                            updated_at:
                              type: string
                              format: date-time
                            ancillary_failed_count:
                              type: integer
                              example: 1
                            ancillary_pending_count:
                              type: integer
                              example: 0
                            needs_refresh:
                              type: boolean
                              example: true
                            donor_details:
                              description: >-
                                Primary-donor display data for each operation in
                                the batch.
                              type: array
                              items:
                                properties:
                                  id:
                                    type: integer
                                    example: 12345
                                  title:
                                    type: string
                                    example: Jane Doe
                                  email:
                                    type: string
                                    example: jane@example.com
                                type: object
                            merged_donor_count:
                              type: integer
                              example: 2
                            operator:
                              properties:
                                id:
                                  type: integer
                                  example: 15
                                name:
                                  type: string
                                  example: Alex Morgan
                              type: object
                              nullable: true
                            relationship_totals:
                              type: object
                              example:
                                donations: 4
                                commitments: 1
                              additionalProperties:
                                type: integer
                            operation_details:
                              description: >-
                                Bounded review summaries. Restore ledgers and
                                field values are excluded.
                              type: array
                              items:
                                properties:
                                  id:
                                    type: integer
                                    example: 91
                                  status:
                                    type: string
                                    example: completed
                                  failure_message:
                                    description: >-
                                      Fixed safe guidance for failed manual
                                      operations only; stored internal errors
                                      are excluded.
                                    type: string
                                  primary_donor:
                                    type: object
                                    nullable: true
                                  selected_donors:
                                    description: >-
                                      Records selected when the operation was
                                      admitted, whether or not it committed.
                                    type: array
                                    items:
                                      type: object
                                  merged_donors:
                                    type: array
                                    items:
                                      type: object
                                  fields_filled:
                                    type: array
                                    items:
                                      type: string
                                  relationships_moved:
                                    type: object
                                    additionalProperties:
                                      type: integer
                                  committed_at:
                                    type: string
                                    format: date-time
                                    nullable: true
                                  ancillary_status:
                                    type: string
                                    nullable: true
                                type: object
                          type: object
                    type: object
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedResponse'
        '500':
          description: Lookup failure
          content:
            application/json:
              schema:
                properties:
                  message:
                    type: string
                    example: Failed to get merge batches.
                type: object
      security:
        - bearerAuth: []
        - apiKeyAuth: []
components:
  schemas:
    PaginatedResponse:
      title: PaginatedResponse
      description: >-
        Standard Laravel `LengthAwarePaginator` JSON envelope. The `data` array
        contains the page's items and is the only field whose shape varies per
        endpoint — wrap this schema in an `allOf` and override `data` to point
        at the resource type. The remaining fields are paginator metadata.
      required:
        - current_page
        - data
        - per_page
        - total
      properties:
        current_page:
          description: 1-indexed current page number.
          type: integer
          example: 1
        data:
          description: >-
            Page items. Override this in endpoint-specific schemas with a `$ref`
            to the resource type.
          type: array
          items:
            type: object
        first_page_url:
          type: string
          format: uri
          example: https://api.gratona.com/v1/donors?page=1
        from:
          description: >-
            1-indexed position of the first item on this page (null when the
            page is empty).
          type: integer
          example: 1
          nullable: true
        last_page:
          description: Total number of pages.
          type: integer
          example: 12
        last_page_url:
          type: string
          format: uri
          example: https://api.gratona.com/v1/donors?page=12
        next_page_url:
          type: string
          format: uri
          example: https://api.gratona.com/v1/donors?page=2
          nullable: true
        path:
          type: string
          format: uri
          example: https://api.gratona.com/v1/donors
        per_page:
          description: Page size.
          type: integer
          example: 25
        prev_page_url:
          type: string
          format: uri
          example: null
          nullable: true
        to:
          description: >-
            1-indexed position of the last item on this page (null when the page
            is empty).
          type: integer
          example: 25
          nullable: true
        total:
          description: Total number of items across all pages.
          type: integer
          example: 287
        links:
          description: >-
            Pagination link objects emitted by Laravel's paginator (sometimes
            present, sometimes omitted depending on the endpoint).
          type: array
          items:
            properties:
              url:
                type: string
                format: uri
                nullable: true
              label:
                type: string
              active:
                type: boolean
            type: object
      type: object
    UnauthorizedResponse:
      title: UnauthorizedResponse
      description: >-
        Returned with HTTP 401 when the request lacks a valid Passport bearer
        token, a valid `X-HYS-API-Key`, or a valid session. The body is the
        simple `{message, status}` envelope emitted by `AuthenticateApiOrKey`.
      required:
        - message
        - status
      properties:
        message:
          description: >-
            Always the literal string `Unauthorized` from the `auth.api_or_key`
            middleware. Login endpoints return `Invalid Credentials` instead.
          type: string
          example: Unauthorized
        status:
          type: string
          example: error
      type: object
  securitySchemes:
    bearerAuth:
      type: http
      description: Passport bearer token authentication for legacy admin sessions.
      scheme: bearer
      bearerFormat: JWT
    apiKeyAuth:
      type: apiKey
      description: Gratona API key sent with the compatibility header X-HYS-API-Key.
      name: X-HYS-API-Key
      in: header

````

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