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

# List sync batches for a company

> Pagination is returned in the `X-Total-Count`, `X-Page-Count`, `X-Limit`, `X-Offset` response headers. Prefer the `/paged` variant if you'd rather have it in the body.



## OpenAPI

````yaml /openapi/accounting.json get /sync/companies/{companyId}/batches
openapi: 3.1.0
info:
  title: Sync2Books Accounting API
  version: 1.0.0
  description: >-
    Write categorized expenses, bills, invoices, and payments to your customers'
    accounting systems (QuickBooks Online, Xero, Sage, Dynamics 365 Business
    Central, Odoo) through one API.


    This is a **separate product** from the [Sync2Books Compliance API
    (eTIMS)](/etims-overview) — use this one to sync bookkeeping data to an
    accounting system; use that one for KRA tax compliance in Kenya. A company
    can use either, both, or neither.


    Writes are **asynchronous**: most create endpoints queue the record and
    return a `syncBatchId` you confirm via the [Sync](#tag/Sync) endpoints — see
    [The sync model](/concepts/sync-model).
servers:
  - url: https://api.sync2books.com
    description: Production
  - url: https://sandbox-api.sync2books.com
    description: Sandbox (coming soon)
security:
  - ApiKeyAuth: []
tags:
  - name: Companies
    description: Your customers — the entities you sync data for.
  - name: Expenses
    description: Categorized expenses, receipts, and payments.
  - name: Bills
    description: Accounts-payable documents (money you owe suppliers).
  - name: Invoices
    description: Accounts-receivable documents (money customers owe you).
  - name: Bill Payments
    description: Payments applied against one or more bills.
  - name: Attachments
    description: Receipts and supporting documents on a synced transaction.
  - name: Sync
    description: Track and retry the asynchronous batches every write creates.
paths:
  /sync/companies/{companyId}/batches:
    get:
      tags:
        - Sync
      summary: List sync batches for a company
      description: >-
        Pagination is returned in the `X-Total-Count`, `X-Page-Count`,
        `X-Limit`, `X-Offset` response headers. Prefer the `/paged` variant if
        you'd rather have it in the body.
      parameters:
        - name: companyId
          in: path
          required: true
          schema:
            type: string
            format: uuid
        - name: status
          in: query
          schema:
            type: string
            enum:
              - pending
              - in_progress
              - completed
              - failed
              - partially_completed
        - name: destination
          in: query
          schema:
            $ref: '#/components/schemas/IntegrationKeyType'
        - name: q
          in: query
          schema:
            type: string
          description: Search by batch id, company name, or destination.
        - name: from
          in: query
          schema:
            type: string
            format: date-time
        - name: to
          in: query
          schema:
            type: string
            format: date-time
        - name: limit
          in: query
          schema:
            type: integer
            minimum: 1
        - name: offset
          in: query
          schema:
            type: integer
            minimum: 0
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/SyncBatchListItem'
components:
  schemas:
    IntegrationKeyType:
      type: string
      enum:
        - quickbooks
        - xero
        - sage
        - microsoft-dynamics-365-business-central
        - odoo
        - etims
        - opera
      description: >-
        `etims` connections are managed through the separate [Compliance
        API](/etims-overview), not this one.
    SyncBatchListItem:
      type: object
      properties:
        id:
          type: string
        status:
          type: string
          enum:
            - pending
            - in_progress
            - completed
            - failed
            - partially_completed
        totalItems:
          type: integer
        syncedItems:
          type: integer
        failedItems:
          type: integer
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
        connectionId:
          type: string
        companyId:
          type: string
        destination:
          $ref: '#/components/schemas/IntegrationKeyType'
        source:
          type:
            - string
            - 'null'
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
      description: >-
        Your application's API key (`sk_development_…` or `sk_production_…`). An
        optional `X-Signature` / `X-Timestamp` HMAC pair may additionally be
        sent for stronger security — see
        [Authentication](/concepts/authentication).

````

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