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

# Create Token Report API

> Generate a Breezing token report with per-token gain/loss, opening and closing balances, and fiat figures for the period, across all chains.



## OpenAPI

````yaml POST /reports/token
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:
  /reports/token:
    post:
      tags:
        - Reports
      summary: Generate a token report
      description: >-
        Create a token report: net gain/loss per token for the period
        (opening/closing balances, in/out, realized/unrealized net, plus fiat
        figures), mirroring the dashboard's "Generate new report" form. Reports
        always cover ALL chains.


        Generation is ASYNCHRONOUS: the response returns the pending report and
        task ids immediately. Poll GET /tasks and GET /reports/{id} until the
        status is no longer "pending"/"progress" ("done" = detail rows are ready
        via GET /reports/{id}/details). Parallel report creation is allowed (no
        409 gating, dashboard parity), so do NOT create another report with the
        same parameters while one is still pending; check GET /reports first.


        tokens and wallets are optional; omitting either (or passing []) covers
        ALL of the company's non-spam tokens and/or ALL wallets. Set
        isPerWallet=true with more than one wallet for a combined report with a
        per-wallet breakdown.


        For a balance sheet by GL account use POST /reports/account; for an
        on-chain balances reconciliation use POST /reports/explorer-balances.


        Before a token report, make sure net gain/loss is up to date (POST
        /ngl/calculate) or the realized/unrealized figures will be stale.
      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
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateTokenReportBody'
      responses:
        '200':
          description: Report generation queued
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - true
                  data:
                    type: object
                    properties:
                      reportId:
                        type: integer
                        description: >-
                          ID of the (pending) report row. Poll GET
                          /reports/{id}.
                      taskId:
                        type: integer
                        description: >-
                          ID of the createReport task tracking generation. Poll
                          GET /tasks.
                    required:
                      - reportId
                      - taskId
                required:
                  - success
                  - data
        '400':
          description: >-
            dateTo before dateFrom, or an empty tokens/wallets selection on a
            company that has no tokens/wallets
          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
        '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:
    CreateTokenReportBody:
      type: object
      properties:
        name:
          type: string
          minLength: 1
          maxLength: 200
          description: Report name shown in the reports list.
        description:
          type: string
          maxLength: 2000
          description: Optional free-text description.
        dateFrom:
          type: integer
          minimum: 0
          exclusiveMinimum: true
          description: Period start (unix ms).
        dateTo:
          type: integer
          minimum: 0
          exclusiveMinimum: true
          description: Period end (unix ms). Must be >= dateFrom.
        tokens:
          type: array
          items:
            type: string
          maxItems: 500
          description: >-
            Token symbols to include (max 500), e.g. from GET /assets. Omit or
            pass [] to include ALL of the company's non-spam tokens.
        wallets:
          type: array
          items:
            type: integer
          maxItems: 500
          description: >-
            Wallet IDs to include (from GET /wallets). Omit or pass [] to
            include ALL of the company's wallets.
        includeSlippage:
          type: boolean
          description: >-
            When true, the report adds the slippage fiat amount to closing
            balances. Ignored (dropped) in per-wallet mode, matching the
            dashboard.
        isPerWallet:
          type: boolean
          description: >-
            When true AND more than one wallet is covered, generates one
            combined report with a per-wallet breakdown (one generation job per
            wallet). With a single wallet it falls back to a regular report,
            matching the dashboard.
      required:
        - name
        - dateFrom
        - dateTo

````