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

# Export Journals API

> Export the journal entries of selected Breezing transactions as a CSV file, built with the same engine as the Xero, QuickBooks, and Bexio syncs.



## OpenAPI

````yaml POST /transactions/export-journals
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/export-journals:
    post:
      tags:
        - Transactions
      summary: Export journal entries as CSV (background task)
      description: >-
        Generate the journal entries of the selected transactions with the same
        engine the Xero, QuickBooks and Bexio syncs use, and write them to a
        CSV. Runs in the background: the call returns `{ taskId }` immediately.
        Poll GET /tasks?id=<taskId>: when the task reaches status "ready",
        `metadata.link` is a download link valid for 24 hours and
        `metadata.fileName` the file name. Each row carries the journal date,
        the account code and name, the description, the debit or credit amount
        in the company currency, the tax code and the narration, with one line
        per journal leg ("indiv") or summed per month, account and tax code
        ("groupedByMonth") or per account and tax code ("group").


        Select either explicit `ids` (max 500) or `filters` (the GET
        /transactions filter set plus `isLocked`, which defaults to "all" here
        because closed periods belong in the books). Transactions that cannot be
        journaled (missing asset account mapping, missing fee or gain/loss
        account) fail the task with the reason in `error`, exactly like the
        dashboard export.


        Read access is enough: a read key can export, as a read-only member can
        from the dashboard. Returns 403 USAGE_LIMIT_EXCEEDED when the company
        has used its plan limit.
      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:
        required: false
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ExportJournalsBody'
      responses:
        '200':
          description: Export 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 (ids and filters together)
          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:
    ExportJournalsBody:
      type: object
      properties:
        method:
          type: string
          enum:
            - indiv
            - groupedByMonth
            - group
          default: indiv
          description: >-
            "indiv" = one line per journal leg (default). "groupedByMonth" =
            totals per month, account and tax code. "group" = totals per account
            and tax code.
        ids:
          type: array
          items:
            type: integer
          minItems: 1
          maxItems: 500
          description: >-
            Export exactly these transactions (max 500). Mutually exclusive with
            filters.
        filters:
          $ref: '#/components/schemas/ExportJournalsFilters'
    ExportJournalsFilters:
      allOf:
        - $ref: '#/components/schemas/BulkTransactionFilters'
        - type: object
          properties:
            isLocked:
              type: string
              enum:
                - 'true'
                - 'false'
                - all
              default: all
              description: >-
                Lock filter for the export (default "all": closed periods are
                part of the books). "false" exports unlocked rows only, "true"
                locked rows only.
      description: >-
        Export every transaction matching these filters. Omitted = the whole
        company (spam excluded, locked rows included).
    BulkTransactionFilters:
      type: object
      properties:
        walletId:
          type: integer
          minimum: 0
          exclusiveMinimum: true
          description: Only transactions of this wallet. Use GET /wallets to find IDs.
        status:
          type: string
          enum:
            - notStarted
            - reviewRequired
            - reconciled
            - manuallyReconciled
            - paid
            - synced
          description: Only transactions in this status.
        account:
          type: string
          description: Only transactions with exactly this contra account code.
        hasAccount:
          type: boolean
          description: >-
            false = only transactions without a contra account (uncategorized),
            true = only categorized ones. Ignored when account is set.
        isSpam:
          type: string
          enum:
            - 'true'
            - 'false'
            - all
          default: 'false'
          description: >-
            Spam filter (default "false"). "all" includes spam rows, "true"
            targets only spam rows.
        dateFrom:
          type: integer
          minimum: 0
          exclusiveMinimum: true
          description: Start of the date window (unix seconds).
        dateTo:
          type: integer
          minimum: 0
          exclusiveMinimum: true
          description: >-
            End of the date window (unix seconds). Defaults to now when only
            dateFrom is set.

````

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