> ## 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.

# Detect Internal Transfers API

> Clear and re-run Breezing's automatic internal transfer detection across a company after adding wallets or correcting addresses.



## OpenAPI

````yaml POST /transactions/detect-internals
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:
  /transactions/detect-internals:
    post:
      tags:
        - Transactions
      summary: Re-detect internal transfers across the company (background task)
      description: >-
        Clear the internal transfer links of every unlocked, non-spam
        transaction and run the automatic internal transfer detection again over
        the whole company (the dashboard "Reset internals" action). Internal
        transfers are movements between two of the company's own wallets: the
        matcher pairs an out leg with the in leg of the same amount and token on
        another company wallet, flags both `isInternal` and links them with a
        shared `internalId`. Use it after adding wallets or correcting
        addresses, when transfers between your own wallets show as external
        deposits and withdrawals. Locked rows keep their links.


        Runs in the background: returns `{ taskId }`, poll GET
        /tasks?id=<taskId>. Returns 409 TASK_IN_PROGRESS while a detection is
        already running. Manual links made with POST
        /transactions/group-internals on unlocked rows are cleared and
        re-derived too; redo them afterwards if the matcher does not find them.
      parameters:
        - 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
      responses:
        '200':
          description: Background task created
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - true
                  data:
                    type: object
                    properties:
                      taskId:
                        type: number
                        description: >-
                          The background task. Poll GET /tasks?id=<taskId> until
                          it leaves "pending"/"progress"; a "done" task
                          disappears from that list.
                      count:
                        type: number
                        nullable: true
                        description: >-
                          Rows the task will process, as counted when it was
                          created.
                    required:
                      - taskId
                      - count
                required:
                  - success
                  - data
        '400':
          description: Invalid body
          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
        '409':
          description: >-
            The same kind of task is already running for this company
            (TASK_IN_PROGRESS)
          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: {}

````

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