> ## 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 Attachment Upload Link API

> Request a signed upload link to attach a receipt, invoice, or statement to a Breezing transaction, the first step of a file upload.



## OpenAPI

````yaml POST /transactions/{id}/attachments/upload-link
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/{id}/attachments/upload-link:
    post:
      tags:
        - Transactions
      summary: Mint an upload link for a transaction attachment
      description: >-
        Step 1 of attaching a file (receipt, invoice, statement) to a
        transaction. Accepted types: PDF, PNG, JPEG, WebP, HEIC, HEIF, CSV,
        XLSX; the content type is derived from the extension. Every file goes
        through a worker before it is stored: images (PNG, JPEG, WebP, HEIC,
        HEIF) are re-encoded and stored as JPEG (quality 85, long edge at most
        3000 pixels, metadata stripped), documents (PDF, CSV, XLSX) are scanned
        for malware; the registration answers 202 with a task id and the
        attachment is listed once the file passed (poll GET /tasks; a refused
        file names itself in the task error). Returns a signed upload URL valid
        for 15 minutes and the storagePath that identifies the object. Step 2:
        PUT the raw file bytes to `uploadUrl` with every header in
        `requiredHeaders` exactly as returned (the Content-Type the link was
        signed for and the size cap; no multipart, no auth header); the
        signature makes the storage refuse a PUT without them or with a file
        over `maxBytes` (20 MB). Step 3: POST /transactions/{id}/attachments
        with the storagePath to register it; an uploaded object that is never
        registered is invisible, not listed, and 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.
      parameters:
        - schema:
            type: string
            description: Transaction ID
            example: '1'
          required: true
          description: Transaction 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/AttachmentUploadLinkBody'
      responses:
        '200':
          description: Upload link minted
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - true
                  data:
                    type: object
                    properties:
                      uploadUrl:
                        type: string
                        description: >-
                          Signed URL. PUT the file bytes to it with the same
                          Content-Type header, within 15 minutes.
                      storagePath:
                        type: string
                        description: >-
                          Object name to pass to POST
                          /transactions/{id}/attachments once the upload
                          finished.
                      expiresInSeconds:
                        type: number
                      maxBytes:
                        type: number
                        description: Largest file the link accepts, in bytes (20 MB).
                      requiredHeaders:
                        type: object
                        properties:
                          Content-Type:
                            type: string
                          x-goog-content-length-range:
                            type: string
                        required:
                          - Content-Type
                          - x-goog-content-length-range
                        description: >-
                          Headers the PUT must send exactly; the storage refuses
                          the upload without them.
                    required:
                      - uploadUrl
                      - storagePath
                      - expiresInSeconds
                      - maxBytes
                      - requiredHeaders
                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
        '404':
          description: Transaction 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
        '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:
    AttachmentUploadLinkBody:
      type: object
      properties:
        contentType:
          type: string
          minLength: 1
          maxLength: 120
          description: >-
            Ignored since 2026-10-23: the content type is derived from the
            extension and returned in requiredHeaders.
          example: application/pdf
        extension:
          type: string
          enum:
            - pdf
            - png
            - jpg
            - jpeg
            - webp
            - heic
            - heif
            - csv
            - xlsx
          description: >-
            File extension without the dot, lower case. Accepted: pdf, png, jpg,
            jpeg, webp, heic, heif, csv, xlsx.
          example: pdf
      required:
        - extension

````

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