Attach Files to Transactions
This guide explains how to attach receipts and supporting documents to accounting transactions through the Fiskl API. You can also list a transaction's files, download them, and remove them. Files you attach through the API appear on the transaction in Fiskl, next to files added in the app.
Before You Begin
- Create an API key with the permissions below. See Create and Manage API Keys.
- Attaching files needs a Fiskl plan with accounting.
- Have the ID of the transaction. The
/v1/transactionsendpoints return it when you create or list transactions.
| Action | API key permission | OAuth scope |
|---|---|---|
| List files and get a download link | accounting.read | accounting:read |
| Attach and remove files | transaction.write | transactions:write |
Endpoints
All four endpoints sit under the transaction the files belong to.
| Method | Path | Returns |
|---|---|---|
GET | /v1/transactions/{id}/attachments | 200 and the list of files |
POST | /v1/transactions/{id}/attachments | 201 and the new file |
GET | /v1/transactions/{id}/attachments/{attachmentId}/download-url | 200 and a download link |
DELETE | /v1/transactions/{id}/attachments/{attachmentId} | 200 with an empty body |
{id} is the transaction ID. {attachmentId} is the file's id, a text value that the attach and list requests return.
Attach a File
Send the file as multipart/form-data, in a part named file. Each request attaches one file:
curl -X POST https://api.fiskl.com/v1/transactions/12345/attachments \
-H "Authorization: Bearer fsk_your_key_here" \
-F "file=@receipt.pdf;type=application/pdf"
A successful request returns 201 and the new file:
{
"id": "3f6c2a9e-8f1b-4d6a-9c1e-2b7d5a4e8c10",
"filename": "receipt.pdf",
"contentType": "application/pdf"
}
The new file goes after any files already on the transaction. As in the app, you can attach files to a transaction in a locked period. The same applies to a transaction created from another Fiskl document. Attaching a file does not change the transaction's updated time.
File Rules
- Types: JPEG, PNG, WebP, GIF, HEIC, HEIF, PDF, DOCX, XLSX, PPTX, ODT, ODS, CSV, and TXT
- Size: up to 12 MB per file, and up to 10 MB for requests through
api.fiskl.com - File name: up to 255 characters
If the part has no type, or a generic one such as application/octet-stream, Fiskl takes the type from the file name's extension. Archives and macro-enabled Office files are not accepted.
Where Attached Files Appear
Go to Accounting > Transactions and open the transaction's ledger account. Select the paperclip icon in the transaction's row to see its files, including the ones you attached through the API.
List a Transaction's Files
curl https://api.fiskl.com/v1/transactions/12345/attachments \
-H "Authorization: Bearer fsk_your_key_here"
The response lists the files in the order they were attached:
[
{ "id": "3f6c2a9e-8f1b-4d6a-9c1e-2b7d5a4e8c10", "filename": "receipt.pdf", "contentType": "application/pdf" },
{ "id": "9b1d7c42-0e5a-4f3b-8a6d-1c2e3f4a5b6c", "filename": "photo.jpg", "contentType": "image/jpeg" }
]
GET /v1/transactions/{id} returns the same list in its attachments field. Rows of the GET /v1/transactions list don't include the attachments field, so read a single transaction when you need its files.
Download a File
Downloading takes two requests. First, ask for a download link:
curl https://api.fiskl.com/v1/transactions/12345/attachments/3f6c2a9e-8f1b-4d6a-9c1e-2b7d5a4e8c10/download-url \
-H "Authorization: Bearer fsk_your_key_here"
{
"url": "https://…/transaction/3f6c2a9e-8f1b-4d6a-9c1e-2b7d5a4e8c10?X-Amz-Signature=…",
"expiresAt": "2026-03-14T10:20:00Z"
}
Then download the file from url with a plain GET. Don't send the Authorization header with this request:
curl -o receipt.pdf "<url from the response>"
A download link works for 5 minutes, until the expiresAt time. Ask for a new link each time you download a file, rather than storing links.
Remove a File
curl -X DELETE https://api.fiskl.com/v1/transactions/12345/attachments/3f6c2a9e-8f1b-4d6a-9c1e-2b7d5a4e8c10 \
-H "Authorization: Bearer fsk_your_key_here"
This detaches the file from the transaction, the same as removing it in the app.
Updating a Transaction Keeps Its Files
PUT /v1/transactions/{id} leaves the transaction's files as they are. Add and remove files only through the /attachments endpoints.
Attach Files Through Your AI Assistant
If you use Fiskl MCP, ask your preferred AI to attach a file to a transaction. It gives you a link to a Fiskl upload page. The link works once, for 15 minutes, and needs no sign-in.
-
Open the link
The page shows Attach a file to a transaction.
-
Select the file
Select the file box, then pick the receipt or document.
-
Attach it
Select Attach. The page shows Attached when the file is on the transaction.
Your AI assistant can also list a transaction's files, give you a download link, and remove a file.
Why Your AI Assistant Gives You a Link
The link works around a limit of MCP, the standard that connects AI assistants to Fiskl. An AI assistant exchanges text with Fiskl through MCP, and MCP has no standard way to send a file. The API has no such limit: you send the file in the request itself, so no link is needed.
Instead, the file goes to Fiskl through the link, from your browser or from the AI assistant's own tools. The link is limited to keep the upload safe:
- It attaches a file only to the transaction you asked about.
- It works once and expires after 15 minutes.
- A rejected file, such as an unsupported type, does not use it up, so you can try another file.
- The transaction's history shows you as the person who attached the file.
Common Issues
The request returns 400 and says the file type cannot be attached
The file is not one of the supported types, or its part carries a type Fiskl does not accept. Convert the file to a supported type, such as PDF. If the file is supported, send its type in the part, for example type=application/pdf, or give the file name the right extension.
The request returns 400 and asks for a plan with accounting
Attaching files needs a Fiskl plan with accounting. Move to a plan that includes accounting, then send the request again. See how to select a Fiskl plan.
The request returns 404
The transaction does not belong to the company of your API key, or the file is no longer on that transaction. Check the transaction ID, then list its files again to get current file IDs.
The download link does not work
The link expires 5 minutes after you request it. Request a new link and download the file straight away. Send the download request without the Authorization header.
Your AI assistant cannot attach files to transactions
Your AI assistant loads the list of Fiskl tools when it connects. Reconnect Fiskl MCP in your AI assistant so it loads the current tools, then ask again.
Related Topics
- Make Your First API Request — Authenticate and call the API
- Create and Manage API Keys — Create a key with the permissions this guide uses
- Use the Interactive API Docs — See every field of these endpoints at api-docs.fiskl.com
- Connect Your Preferred AI — Attach files to transactions in conversation
- What You Can Do with the API — The full list of available data and actions
Was this page helpful?