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

# Uploading attachments

> Attach invoices and receipts to transactions, supplier invoices, and client invoices

The MCP server can attach a file (an invoice or a receipt) to Qonto without ever streaming the file bytes through the model's context. It is a two-step handshake: the server hands your client a short-lived presigned upload URL, your client uploads the file straight to object storage, then the server forwards the staged file to Qonto.

For reading, listing, or detaching attachments already on a transaction, see [Transactions and statements](/mcp/tools/transactions-and-statements).

## The two-step flow

1. **`request_attachment_upload`** returns a short-lived presigned `upload_url` and an opaque `blob_ref`.
2. **Your client uploads the file** to `upload_url` with an HTTP `PUT`, sending the same `Content-Type`. The bytes go straight to object storage, never through the model.
3. **`upload_attachment`** takes the `blob_ref` and a `target`, reads the staged file, and pushes it to Qonto.

```bash theme={null}
# Step 2: your client PUTs the raw bytes to the presigned URL
curl -X PUT \
  -H "Content-Type: application/pdf" \
  --upload-file invoice-2026-06.pdf \
  "$UPLOAD_URL"
```

## Tools

| Tool                        | What it does                                                                                                                                                      | Upstream                        |
| --------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------- |
| `request_attachment_upload` | Step 1. Returns a presigned `upload_url` (PUT), a `blob_ref`, the accepted `content_type`, the size limit, and an expiry. Accepts PDF, JPEG, and PNG up to 15 MB. | Object storage (presigned PUT)  |
| `upload_attachment`         | Step 2. Reads the staged `blob_ref` and forwards it to Qonto as the chosen `target`. The staged file is deleted once Qonto accepts it.                            | Depends on `target` (see below) |

## Targets

`upload_attachment` routes the file to one of four destinations via its `target` argument:

| `target`           | What it does                                                                                                                                                                | Returns                                                                                            | Upstream                                                                                                                                                  |
| ------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `standalone`       | Create a reusable attachment, not linked to anything yet.                                                                                                                   | `attachment_id`, to reference from a transfer, supplier invoice, or another `attachment_id` field. | [Upload an attachment](/api-reference/business-api/expense-management/attachments/upload-an-attachment)                                                   |
| `transaction`      | Attach the file to a transaction (`transaction_id` required). Qonto processes it asynchronously, so it can take a few seconds to surface in `list_transaction_attachments`. | —                                                                                                  | [Upload an attachment to a transaction](/api-reference/business-api/expense-management/attachments-in-transactions/upload-an-attachment-to-a-transaction) |
| `supplier_invoice` | Create a supplier invoice from the file. Qonto OCR then extracts the supplier, invoice number, dates, amounts, and VAT. The per-file limit is 10 MB.                        | The raw `response.supplier_invoices` and `response.errors` for the per-item outcome.               | [Create supplier invoices](/api-reference/business-api/expense-management/supplier-invoices/create-supplier-invoices)                                     |
| `client_invoice`   | Stage the file for a client invoice.                                                                                                                                        | `upload_id`, to pass to `create_client_invoice` as `upload_id`.                                    | [Create a client invoice upload](/api-reference/business-api/expense-management/client-quotes-notes/client-invoices/create-a-client-invoice-upload)       |

## Limits and formats

* **Formats:** PDF, JPEG, PNG.
* **Size:** up to 15 MB (10 MB for `supplier_invoice`).
* **Expiry:** the presigned `upload_url` is valid for about 15 minutes. Request a fresh one if it lapses before the file is uploaded.

<Warning>
  The presigned `upload_url` is a short-lived write credential to object storage. The server hands it to your client to upload the file; do not paste it into a chat where it may be logged or shared. Pass an `idempotency_key` to `upload_attachment` to make a retried upload safe.
</Warning>

**Try it**

> Attach this receipt to my last Amazon transaction.
>
> Upload these supplier invoices and tell me the totals Qonto extracted.
>
> Create a draft client invoice for ACME from the attached PDF.
