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

# Wallet Integrity Check API

> Start a Breezing wallet integrity check that re-imports a wallet's history from its source and reports any missing or extra transactions.



## OpenAPI

````yaml POST /wallets/{id}/integrity-check
openapi: 3.1.0
info:
  title: Breezing Public API
  version: 1.0.0
  description: >-
    Crypto accounting API for programmatic access and AI agents. Authenticate
    with an API key using the Authorization header: `Bearer brz_...`
servers:
  - url: https://api.breezing.io/v1
security:
  - BearerAuth: []
paths:
  /wallets/{id}/integrity-check:
    post:
      tags:
        - Wallets
      summary: Start a wallet integrity check (re-import and compare)
      description: >-
        Start a Wallet Integrity Check: Breezing re-imports the wallet's history
        from its source (blockchain explorer or exchange API) into a throwaway
        test company and compares it against the wallet's current ledger, so
        transactions lost to a provider blip are found without touching the
        wallet. Nothing in the company is modified; the outcome is a Wallet
        Difference Report.


        **Window:** the optional body bounds the re-import with
        `dateFrom`/`dateTo` (unix seconds). Defaults: the wallet's stored sync
        start (or 2017-01-01) through now.


        **Result:** returns `{ taskId, dateFrom, dateTo }` immediately; the run
        takes minutes to hours depending on the wallet size. Poll GET
        /tasks?id=<taskId>. Status "ready" means the report is done and
        `metadata.diffTaskId` names the report task: GET /tasks?id=<diffTaskId>
        returns `metadata.report` (`missingInWallet1` = rows the re-import found
        that the wallet lacks, `missingInWallet2` = rows the wallet holds that
        the source no longer returns, `amountMismatches`, `spamMismatches`,
        `totalIssues`) and `metadata.link`, a 24 hour download link to the
        summary CSV. Status "error" carries the reason in `error`.


        **Requirements:** a chain wallet, or an exchange wallet whose API
        credentials are stored on it (400 otherwise: CSV, bank, balance tracking
        and credential-less exchange wallets cannot be re-imported); an active
        subscription with usage under the plan limit (403); one check per wallet
        at a time (409 CONFLICT while one runs, paused included). Course and
        partner sandbox orgs always return 403.
      parameters:
        - schema:
            type: string
            description: Wallet ID
            example: '1'
          required: true
          description: Wallet ID
          name: id
          in: path
        - schema:
            type: string
            description: >-
              Organization ID. Use GET /v1/companies to discover available
              org/company pairs.
            example: '1'
          required: true
          description: >-
            Organization ID. Use GET /v1/companies to discover available
            org/company pairs.
          name: orgId
          in: query
        - schema:
            type: string
            description: >-
              Company ID. Use GET /v1/companies to discover available companies
              and their access levels.
            example: '1'
          required: true
          description: >-
            Company ID. Use GET /v1/companies to discover available companies
            and their access levels.
          name: companyId
          in: query
      requestBody:
        required: false
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WalletIntegrityCheckBody'
      responses:
        '200':
          description: Integrity check started
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - true
                  data:
                    type: object
                    properties:
                      taskId:
                        type: number
                        description: >-
                          The walletIntegrityCheck task tracking the whole run.
                          Poll GET /tasks?id=<taskId>: status "ready" means the
                          report is done and metadata.diffTaskId names the
                          report task (GET /tasks?id=<diffTaskId> returns
                          metadata.report with the difference counts and
                          metadata.link, a 24 hour download link to the summary
                          CSV); status "error" carries the reason in error.
                      dateFrom:
                        type: number
                        description: Resolved re-import window start (unix seconds).
                      dateTo:
                        type: number
                        description: Resolved re-import window end (unix seconds).
                    required:
                      - taskId
                      - dateFrom
                      - dateTo
                required:
                  - success
                  - data
        '400':
          description: Bad request (unsupported wallet type, or dateFrom after dateTo)
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                      message:
                        type: string
                    required:
                      - code
                      - message
                required:
                  - success
                  - error
        '401':
          description: Invalid or missing API key
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                      message:
                        type: string
                    required:
                      - code
                      - message
                required:
                  - success
                  - error
        '403':
          description: >-
            API key has no access to this company, has read-only access where
            write was required, or the company subscription is inactive
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                      message:
                        type: string
                    required:
                      - code
                      - message
                required:
                  - success
                  - error
        '404':
          description: Wallet not found
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                      message:
                        type: string
                    required:
                      - code
                      - message
                required:
                  - success
                  - error
        '409':
          description: >-
            A wallet integrity check is already running for this wallet
            (CONFLICT)
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                      message:
                        type: string
                    required:
                      - code
                      - message
                required:
                  - success
                  - error
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                      message:
                        type: string
                    required:
                      - code
                      - message
                required:
                  - success
                  - error
      security:
        - BearerAuth: []
components:
  schemas:
    WalletIntegrityCheckBody:
      type: object
      properties:
        dateFrom:
          type: integer
          minimum: 0
          exclusiveMinimum: true
          description: >-
            Start of the re-import window (unix seconds). Defaults to the
            wallet's stored sync start, or 2017-01-01 when the wallet has none
            or it lies outside 2017-01-01..now.
        dateTo:
          type: integer
          minimum: 0
          exclusiveMinimum: true
          description: End of the re-import window (unix seconds). Defaults to now.

````

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