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
| Name | Type | Description | Required |
|---|---|---|---|
| file | file | The file to upload (max 2 MB). See Allowed file types | Yes |
| source | string | Id of the document to attach the file to (invoice, estimate, or transaction id) | Yes |
| sourceType | string | Source type, possible values are Invoice, Estimate, or Transaction | Yes |
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
| Name | Type | Description | Required |
|---|---|---|---|
| id | string | Invoice, estimate, or transaction id | Yes |
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
| Name | Type | Description | Required |
|---|---|---|---|
| id | string | Attachment id | Yes |
Body Parameters
| Name | Type | Description | Required |
|---|---|---|---|
| name | string | Attachment 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
| Name | Type | Description | Required |
|---|---|---|---|
| id | string | Attachment id | Yes |
Limits
| Limit | Value |
|---|---|
| File size | 2 MB per file |
| Attachments per source | 3 |
| Attachments per account | 10 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
| Category | Types |
|---|---|
| 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
| Status | Code | Meaning |
|---|---|---|
| 403 | ATTACHMENTS_PRO_ONLY | Attachments require an active Pro Plan |
| 403 | ATTACHMENT_LIMIT_REACHED | The account attachment quota is reached — details.maxAttachments is its value |