Skip to Content
Prets Developer Portal

Upload a quote attachment

POST
/v1/quotes/{quoteId}/attachments

to try read requests with your account, or paste an API key into the Authorization field. Create an API key in the Partner Portal.

Starts uploading a file, such as the signed quote or an invoice, to a quote. Upload the file bytes with an HTTP PUT to links.upload, sending the same Content-Type; Prets then attaches the file to the quote.

Returns the new attachment id and a presigned upload URL that expires after one hour (data.expiresAt). Returns 404 when the quote does not exist or is not visible to you.

Path Parameters

quoteId*string

Quote ID

Match^qot_[0-9A-HJKMNP-TV-Z]{26}$

Request Body

application/json
  1. body

Metadata for a quote attachment upload. Returns a short-lived presigned PUT URL; the client uploads the file bytes separately.

filename*string

Name of the file to upload

Length1 <= length <= 255
contentType*string

MIME type of the file

Value in"application/pdf""image/jpeg""image/png""image/webp"
contentLength*integer

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.

Range0 < value <= 26214400
attachmentType?string

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

Value in"quote_copy""nwf_installers_declarations""invoice"

Response Body

The attachment id and a presigned URL to upload the file to

application/json
  1. response

Presigned upload URL and metadata, aligned with other quote API responses

data*

Attachment resource and upload constraints

links*

Hypermedia links for the attachment upload flow

Authorization

bearerAuth
headerAuthorizationBearer <token>
Example Request
curl -X POST 'https://api.prets.app/v1/quotes/qot_01ARZ3NDEKTSV4RRFFQ69G5FAV/attachments' \  -H 'Content-Type: application/json' \  -d '{  "filename": "contract.pdf",  "contentType": "application/pdf",  "contentLength": 1048576}'
Example Response
{  "data": {    "attachmentId": "att_01HQZX3Y8N9ABCDEFGHMJK1234",    "expiresAt": "2024-12-31T14:30:00.000Z",    "contentType": "application/pdf"  },  "links": {    "upload": "https://bucket.s3.amazonaws.com/key?X-Amz-..."  }}