Attachments
The attachments list embeds files inside the generated PDF. Each file is stored within the PDF, associated with the document, and can be extracted by readers that support PDF attachments (most desktop PDF viewers).
Properties
Each entry of attachments takes:
| Property | Type | Description |
|---|---|---|
filePath | string | The file to embed, a path beside the document. Required |
fileName | string | The name the file carries inside the document. Absent, the file's own name |
description | string | What the file is, shown in a viewer's attachments panel |
relationship | string | What the file is to this document: source, data (behind a table or chart), alternative (another rendering, such as an e-invoice's XML), supplement, schema, formData or unspecified |
mimeType | string | Media type of the file, such as "text/csv". Absent, derived from the file extension |
Examples
Attach a CSV data file
{
"document": {
"attachments": [
{
"fileName": "revenue_data.csv",
"filePath": "attachments/revenue_data.csv",
"description": "Raw revenue data used to generate this report",
"relationship": "data"
}
],
"content": [
{ "p": "See the attached CSV file for the underlying data." }
]
}
}
Attach supporting documentation
{
"document": {
"metadata": {
"title": "Shipping Manifest",
"author": "Logistics Team"
},
"attachments": [
{
"fileName": "customs_declaration.pdf",
"filePath": "attachments/customs_declaration.pdf",
"description": "Customs declaration form for cross-border shipment",
"relationship": "supplement"
}
],
"content": [
{ "p": "This manifest includes the customs declaration as an attachment." }
]
}
}
Uploading the files
Upload a file to embed to your workspace's attachments folder, then name it by that path:
POST /v1/{tenantId}/assets/attachments
Content-Type: multipart/form-data
file: revenue_data.csv
The folder takes .xml, .xsd, .csv, .json, .txt and .pdf files up to 5 MB. A file that is not found is reported as ATTACHMENT_NOT_EMBEDDED in the response's errorCodes.
Where attachments appear
Attached files are accessible through the PDF viewer's attachments panel (sometimes called "paperclip" panel). In Adobe Acrobat, navigate to View > Show/Hide > Navigation Panes > Attachments.