Skip to main content

Attachments

Upload and manage files attached to an invoice, an estimate, or a transaction.

Attachments require an active Pro Plan. See Limits for file size, file types, and quotas, or the attachments guide in our help center for a walkthrough.

Upload Attachment

POST https://api.invoiless.com/v1/attachments

Upload a file and attach it to a source document. This endpoint expects multipart/form-data, not JSON.

Example:

curl https://api.invoiless.com/v1/attachments \
-H "api-key: your-api-key" \
-F "file=@contract.pdf" \
-F "source=source-id" \
-F "sourceType=Invoice"

Form Parameters

NameTypeDescriptionRequired
filefileThe file to upload (max 2 MB). See Allowed file typesYes
sourcestringId of the document to attach the file to (invoice, estimate, or transaction id)Yes
sourceTypestringSource type, possible values are Invoice, Estimate, or TransactionYes

The attachment name is taken from the uploaded file name (without its extension) and sanitized. Use Update Attachment to rename it.

Get Attachments

GET https://api.invoiless.com/v1/attachments/source/:id

Retrieve all attachments of a source document.

Path Parameters

NameTypeDescriptionRequired
idstringInvoice, estimate, or transaction idYes

Each attachment carries a url, a signed download link that expires one hour after it is issued. Request the list again to get a fresh link — don't store it.

Update Attachment

PATCH https://api.invoiless.com/v1/attachments/:id

Rename an attachment. The file itself cannot be replaced — upload a new attachment and delete the old one instead.

Example:

{
"name": "Signed contract"
}

Path Parameters

NameTypeDescriptionRequired
idstringAttachment idYes

Body Parameters

NameTypeDescriptionRequired
namestringAttachment name (max 50 characters)Yes

Delete Attachment

DELETE https://api.invoiless.com/v1/attachments/:id

Delete an attachment. The file stays recoverable for 30 days before it is permanently removed from storage.

Path Parameters

NameTypeDescriptionRequired
idstringAttachment idYes

Limits

LimitValue
File size2 MB per file
Attachments per source3
Attachments per account10 free, plus purchased credits

The Pro Plan comes with 10 free attachments. Need more? Buy additional credits from Settings > Billing — each credit raises the per-account limit.

Deleting an attachment frees a slot against the per-source limit right away. Against the per-account limit it only frees a slot if it is deleted within 24 hours of being uploaded.

Allowed file types

CategoryTypes
Images.jpg, .jpeg, .png
Documents.pdf, .doc, .docx, .xls, .xlsx
Text & data.txt, .csv
Compressed.zip

Uploading any other type returns 403 Forbidden with the message Mime type is not allowed.

Error codes

StatusCodeMeaning
403ATTACHMENTS_PRO_ONLYAttachments require an active Pro Plan
403ATTACHMENT_LIMIT_REACHEDThe account attachment quota is reached — details.maxAttachments is its value