> ## 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 Journal Attachment Links API

> Request signed upload links to attach supporting files, such as contracts or calculations, to a manual journal in Breezing.



## OpenAPI

````yaml POST /journals/{id}/attachment-links
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:
  /journals/{id}/attachment-links:
    post:
      tags:
        - Journals
      summary: Mint upload links for journal attachments
      description: >-
        Step 1 of attaching supporting files (a contract, a calculation, a
        statement) to a manual journal; the dashboard uses the same flow. For
        each file you get a signed PUT URL into Breezing's storage. Upload the
        bytes with an HTTP PUT to `url` carrying EXACTLY the returned
        `requiredHeaders` (the Content-Type derived from the extension and
        `x-goog-content-length-range: 0,20971520`; files above 20971520 bytes
        are rejected by storage). Then call POST /journals/{id}/attachments with
        each file's `storagePath` to attach it. Links expire after 15 minutes
        and an upload that is never registered is never attached and is deleted
        after a day. Quotas: 600 upload links per hour per API key and 2 GB of
        upload volume per company per day (counted from the size cap of each
        link); beyond them the call answers 429 with the reason.


        Supported types: PDF, PNG, JPEG, WebP, HEIC, HEIF, CSV, XLSX. Every file
        goes through a worker before it is attached: images (PNG, JPEG, WebP,
        HEIC, HEIF) are re-encoded and stored as JPEG (quality 85, long edge at
        most 3000 pixels, metadata stripped), documents are scanned for malware;
        the registration answers 202 and the file is listed once it passed (poll
        GET /tasks). A journal holds up to 10 files. Files can be attached to a
        DRAFT or a POSTED manual journal; a voided journal, a superseded version
        and the opening balances answer 409 or 400. Attaching a file never
        changes what the journal books.
      parameters:
        - schema:
            type: string
            description: Journal ID
            example: '12'
          required: true
          description: Journal 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:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/JournalAttachmentLinksBody'
      responses:
        '200':
          description: Links minted
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - true
                  data:
                    type: object
                    properties:
                      links:
                        type: array
                        items:
                          type: object
                          properties:
                            name:
                              type: string
                            url:
                              type: string
                              description: Signed PUT URL, valid 15 minutes.
                            storagePath:
                              type: string
                              description: >-
                                Pass this back verbatim as the file's
                                storagePath in POST /journals/{id}/attachments
                                once the PUT succeeded.
                            maxBytes:
                              type: integer
                            requiredHeaders:
                              type: object
                              additionalProperties:
                                type: string
                              description: Headers the PUT must carry exactly.
                          required:
                            - name
                            - url
                            - storagePath
                            - maxBytes
                            - requiredHeaders
                    required:
                      - links
                required:
                  - success
                  - data
        '400':
          description: Invalid journal ID or 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
        '404':
          description: Journal 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: >-
            The journal no longer takes attachments, or it already holds the
            maximum
          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
        '429':
          description: >-
            Upload link quota reached (links per hour per key, or upload volume
            per company per day)
          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:
    JournalAttachmentLinksBody:
      type: object
      properties:
        files:
          type: array
          items:
            type: object
            properties:
              name:
                type: string
                minLength: 1
                maxLength: 255
                description: Original file name (display only).
                example: hosting-contract.pdf
              extension:
                type: string
                enum:
                  - pdf
                  - png
                  - jpg
                  - jpeg
                  - webp
                  - heic
                  - heif
                  - csv
                  - xlsx
                description: >-
                  The file type. The content type the file is uploaded with is
                  derived from it and returned in requiredHeaders.
            required:
              - name
              - extension
          minItems: 1
          maxItems: 10
          description: Files to mint links for (1-10).
      required:
        - files

````

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