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

# Download an estimate PDF attachment

> Download an estimate PDF attachment through the public API.

The response body is the raw PDF. The `url` of each [listed attachment](https://docs.infinity.swiss/api/estimates/pdf-attachments-list.md) links here with a signature, so you can open it without your API key for one hour. After that, send your API key or list the attachments again. With your API key, you need invoice-module read access.

The response includes an `ETag`. Send it back in `If-None-Match` to get `304 Not Modified` when the file has not changed.


## OpenAPI

````yaml GET /v1/estimates/{estimateId}/pdf-attachments/{attachmentId}
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/{attachmentId}:
    parameters:
      - name: estimateId
        in: path
        required: true
        schema:
          type: string
      - name: attachmentId
        in: path
        required: true
        schema:
          type: string
    get:
      summary: Download estimate PDF attachment
      description: >-
        Returns the attached PDF as a binary stream. The `url` of each listed
        attachment links here with a signature that opens the file without an
        API key for one hour. Without a signature, the request needs the API key
        and invoice-module read access. The response carries an `ETag`, and a
        request with a matching `If-None-Match` header gets `304 Not Modified`.
      operationId: download-estimate-pdf-attachment-v1
      parameters:
        - name: expires
          in: query
          required: false
          description: >-
            Part of a signed link. When the link stops working, as a Unix
            timestamp in seconds.
          schema:
            type: integer
        - name: signature
          in: query
          required: false
          description: >-
            Part of a signed link. Proves that the link was issued by Infinity
            for this attachment.
          schema:
            type: string
      responses:
        '200':
          description: The attached PDF, sent inline with its original filename.
          headers:
            ETag:
              description: Identifies this version of the file.
              schema:
                type: string
            Cache-Control:
              description: >-
                Always `private, no-cache`, so shared caches do not store the
                file.
              schema:
                type: string
          content:
            application/pdf:
              schema:
                type: string
                format: binary
        '304':
          description: The `If-None-Match` header matches the current file.
        '401':
          $ref: '#/components/responses/Unauthorised'
        '403':
          description: >-
            The API key lacks invoice-module read access, or a signed link has
            expired or does not match the attachment and the request carries no
            API key (`files/link-invalid`).
        '404':
          description: >-
            The estimate is missing, belongs to another organisation, or is an
            invoice (`customer-invoices/quote-not-found` or
            `customer-invoices/not-found`), or the attachment does not belong to
            the estimate (`customer-invoices/pdf-attachment-not-found`).
      security:
        - apiKey: []
        - {}
components:
  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
  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.