> For the complete documentation index, see [llms.txt](https://api.qvalia.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://api.qvalia.io/qvalia-developer-tools/attachments-to-messages.md).

# Attachments to messages

Often our customers want to add, or request, attached documents to their messages, e.g. their invoices.

**The total request must stay under 100 MB in total, as that is the current limit in the Peppol network!**

{% hint style="warning" %}
As attachments are base64-encoded inside the message, which increases the payload by about\
33%, you must take care to use the proper size estimate, and not look at the original file size!
{% endhint %}

We support all the same attachments as Peppol does: [Peppol media types](https://docs.peppol.eu/poacc/billing/3.0/bis/#media-type)

| SUPPORTED FILE TYPES |                                                                                                                             |
| -------------------- | --------------------------------------------------------------------------------------------------------------------------- |
| **Do**cuments        | application/pdf                                                                                                             |
| Images               | image/png image/jpeg                                                                                                        |
| Text                 | text/csv                                                                                                                    |
| Spreadsheet          | <p>application/vnd.openxmlformats-officedocument.spreadsheetml.sheet application/vnd.oasis.opendocument.spreadsheet<br></p> |

### Technical details <a href="#technical-details" id="technical-details"></a>

Any attachment has to be `base64` encoded and added under the `AdditionalDocumentReference` element; <https://docs.peppol.eu/poacc/billing/3.0/syntax/ubl-invoice/cac-AdditionalDocumentReference/cac-Attachment/>

<table data-header-hidden><thead><tr><th valign="top"></th><th valign="top"></th></tr></thead><tbody><tr><td valign="top">JSON</td><td valign="top">XML</td></tr><tr><td valign="top"><pre class="language-json" data-overflow="wrap"><code class="lang-json">{
  "AdditionalDocumentReference": [
    {
      "ID": [
        {
          "_": "InvoiceSpecification01"
        }
      ],
      "DocumentType": [
        {
          "_": "Specification"
        }
      ],
      "Attachment": [
        {
          "EmbeddedDocumentBinaryObject": [
            {
              "_": "UjBsR09EbGhjZ0dTQUxNQUFBUUNBRU1tQ1p0dU1GUXhEUzhi",
              "mimeCode": "application/pdf",
              "filename": "InvoiceSpecification01.pdf"
            }
          ]
        }
      ]
    }
  ]
}
</code></pre></td><td valign="top"><pre class="language-xml" data-overflow="wrap"><code class="lang-xml">&#x3C;cac:AdditionalDocumentReference>
  &#x3C;cbc:ID>InvoiceSpecification01&#x3C;/cbc:ID>
  &#x3C;cac:Attachment>
    &#x3C;cbc:EmbeddedDocumentBinaryObject mimeCode="application/pdf" filename="InvoiceSpecification01.pdf">UjBsR09EbGhjZ0dTQUxNQUFBUUNBRU1tQ1p0dU1GUXhEUzhi&#x3C;/cbc:EmbeddedDocumentBinaryObject>
  &#x3C;/cac:Attachment>
&#x3C;/cac:AdditionalDocumentReference>
</code></pre><p><br></p></td></tr></tbody></table>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://api.qvalia.io/qvalia-developer-tools/attachments-to-messages.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
