> ## Documentation Index
> Fetch the complete documentation index at: https://docs.infinity.swiss/llms.txt
> Use this file to discover all available pages before exploring further.

# Add an estimate PDF attachment

> Add an estimate PDF attachment through the public API.

Send the PDF as the `file` part of a multipart request with a `title` field. The response contains the uploaded file under `attachment`. You need invoice-module write access.

You can attach up to ten PDFs to a quote. Each file may be at most 10 MiB (10,485,760 bytes). Infinity checks the actual file contents and rejects PDFs whose pages cannot be rendered.

Issued quotes use the same attachment editability rules as invoices: they must have no payments, must not be annulled, must belong to an editable fiscal year, and must be outside settled VAT periods. Draft attachments remain editable.

Attachments added through the API also appear in the quote editor and generated estimate PDF.


## OpenAPI

````yaml POST /v1/estimates/{estimateId}/pdf-attachments
openapi: 3.1.0
info:
  title: infinity.swiss Open API
  version: '1.0'
  summary: ''
servers:
  - url: https://api.infinity.swiss
security:
  - apiKey: []
paths:
  /v1/estimates/{estimateId}/pdf-attachments:
    parameters:
      - name: estimateId
        in: path
        required: true
        schema:
          type: string
    post:
      summary: Add an estimate PDF attachment
      description: >-
        Uploads one PDF of at most 10 MiB. An estimate can have up to ten
        attachments. Requires invoice-module write access and an editable
        estimate.
      operationId: add-estimate-pdf-attachment-v1
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              required:
                - file
                - title
              properties:
                file:
                  type: string
                  format: binary
                  description: A valid PDF file. Its actual contents determine its type.
                title:
                  type: string
                  description: >-
                    Required upload title. The attachment name comes from the
                    file's original filename.
      responses:
        '201':
          description: The uploaded attachment.
          content:
            application/json:
              schema:
                type: object
                required:
                  - attachment
                properties:
                  attachment:
                    $ref: '#/components/schemas/InvoicePdfAttachment'
        '400':
          description: >-
            Missing upload fields, malformed PDF, or the estimate already has
            ten attachments.
        '401':
          $ref: '#/components/responses/Unauthorised'
        '403':
          $ref: '#/components/responses/InvoiceAttachmentForbidden'
        '404':
          $ref: '#/components/responses/EstimateNotFound'
        '413':
          description: The PDF exceeds 10,485,760 bytes.
        '415':
          description: The file contents are not PDF.
components:
  schemas:
    InvoicePdfAttachment:
      type: object
      required:
        - id
        - url
        - name
        - type
        - size
      properties:
        id:
          type: string
        url:
          type: string
          format: uri
        name:
          type: string
        type:
          type: string
          enum:
            - application/pdf
        size:
          type: integer
          description: File size in bytes.
          maximum: 10485760
  responses:
    Unauthorised:
      description: >-
        An unauthorised request was submitted. You may be using an incorrect or
        expired API token, or are attempting to access a document outside of the
        scope of the token.
      content:
        application/json:
          schema:
            type: object
            properties:
              code:
                type: string
                x-stoplight:
                  id: 08hkw8ukmi2lp
                description: Specific error code
          examples:
            Unauthorised request:
              value:
                code: general/unauthorised
    InvoiceAttachmentForbidden:
      description: >-
        Invoice-module access is missing, or attachments are read-only. Issued
        invoices and estimates become read-only when annulled, paid, outside an
        editable fiscal year, or in a settled VAT period. Draft attachments
        remain editable.
      content:
        application/json:
          schema:
            type: object
            properties:
              code:
                type: string
                enum:
                  - rest-api/insufficient-scope
                  - customer-invoices/attachments-read-only
    EstimateNotFound:
      description: >-
        The estimate is missing or the id refers to an invoice
        (customer-invoices/quote-not-found), or the estimate belongs to another
        organisation (customer-invoices/not-found).
      content:
        application/json:
          schema:
            type: object
            properties:
              code:
                type: string
                enum:
                  - customer-invoices/quote-not-found
                  - customer-invoices/not-found
  securitySchemes:
    apiKey:
      name: x-api-token
      type: apiKey
      in: header
      description: >-
        API token for authentication. Obtain from your Infinity account
        settings.

````

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