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

# Upload a quote attachment



## OpenAPI

````yaml https://api.prets.io/v1/openapi.json post /v1/quotes/{quoteId}/attachments
openapi: 3.1.0
info:
  title: Prets API
  version: 1.0.0
servers:
  - url: https://api.prets.app
security:
  - bearerAuth: []
paths:
  /v1/quotes/{quoteId}/attachments:
    post:
      summary: Upload a quote attachment
      parameters:
        - schema:
            type: string
            pattern: ^qot_[0-9A-HJKMNP-TV-Z]{26}$
            description: Quote ID
            example: qot_01ARZ3NDEKTSV4RRFFQ69G5AV
          required: true
          description: Quote ID
          name: quoteId
          in: path
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PostAttachmentRequest'
      responses:
        '201':
          description: Presigned URL created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PostAttachmentResponse'
        '400':
          description: Bad request - invalid parameters
        '401':
          description: Unauthorized - authentication required
        '403':
          description: Forbidden - not authorized to access this quote
        '404':
          description: Quote not found
        '500':
          description: Internal server error
components:
  schemas:
    PostAttachmentRequest:
      type: object
      properties:
        filename:
          type: string
          minLength: 1
          maxLength: 255
          description: Name of the file to upload
          example: contract.pdf
        contentType:
          type: string
          enum:
            - application/pdf
            - image/jpeg
            - image/png
            - image/webp
          description: MIME type of the file
          example: application/pdf
        contentLength:
          type: integer
          exclusiveMinimum: 0
          maximum: 26214400
          description: >-
            Size of the file in bytes (max 25MB). The limit accommodates
            high-resolution scans and multi-page documents while preventing
            abuse. Typical quote PDFs are 1-5MB.
          example: 1048576
        attachmentType:
          type: string
          enum:
            - quote_copy
            - nwf_installers_declarations
            - invoice
          description: >-
            Type of attachment for categorization. quote_copy: original
            quote/offer document sent to customer; nwf_installers_declarations:
            NWF (Dutch subsidy) installer declaration forms; invoice: final
            invoice or billing document
          example: invoice
      required:
        - filename
        - contentType
        - contentLength
    PostAttachmentResponse:
      type: object
      properties:
        data:
          type: object
          properties:
            attachmentId:
              type: string
              pattern: ^att_[0-9A-HJKMNP-TV-Z]{26}$
              description: Unique identifier for the attachment
              example: att_01HQZX3Y8N9ABCDEFGHIJK1234
            expiresAt:
              type: string
              format: date-time
              description: Expiration timestamp of the presigned URL (ISO 8601)
              example: '2024-12-31T14:30:00.000Z'
            contentType:
              type: string
              enum:
                - application/pdf
                - image/jpeg
                - image/png
                - image/webp
              description: >-
                MIME type that must be sent as the Content-Type header on the
                PUT upload (matches the signed request)
              example: application/pdf
          required:
            - attachmentId
            - expiresAt
            - contentType
          description: Attachment resource and upload constraints
        links:
          type: object
          properties:
            upload:
              type: string
              format: uri
              description: >-
                Presigned S3 URL; upload with HTTP PUT and Content-Type equal to
                data.contentType
              example: https://bucket.s3.amazonaws.com/key?X-Amz-...
          required:
            - upload
          description: Hypermedia links for the attachment upload flow
      required:
        - data
        - links
      description: >-
        Presigned upload URL and metadata, aligned with other quote API
        responses
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````