attachments field: a JSON array of objects (not raw strings or bare URLs). Each object describes one file for the AI pipeline.
Endpoints that use this shape include (non-exhaustive): invoices, bills, expenses, income, journals, contacts, chart of accounts (POST /accounts), and POST /bank-transactions/upload.
Attachment object
| Field | Required | Type | Description |
|---|---|---|---|
file | Yes | string | Content interpreted per type — must be non-empty |
type | Yes | string | One of base64, url, or raw. Always required — for Base64 file bytes you must send "type": "base64"; the API does not treat a bare string in file as Base64 when type is missing |
name | Recommended | string | Original filename including extension (e.g. statement-jan.pdf, export.csv). Used for type detection (PDF, CSV, Excel, images). If omitted, a generic name may break detection |
type values for file
type | Meaning |
|---|---|
base64 | Standard Base64-encoded file bytes (no data:...;base64, prefix). You must set "type": "base64" alongside file |
url | Public https:// URL the server fetches once (timeout and HTTP success required) |
raw | Raw binary as string (uncommon in JSON; prefer base64) |
Examples
One PDF as Base64
File hosted at a URL
Usage notes
- Base64: never omit
type. Sending only a long string infilewithout"type": "base64"is invalid for Base64 content. - Multiple attachments: each object is processed; for async jobs, processing is often one job per attachment.
- Omit or empty array: use
[]or omitattachmentswhen you only sendpromptand optionaltext_attachment. - Bank statement files: for
POST /bank-transactions/upload, supported types follow the filename extension: pdf, csv, xlsx, xls, and common images (jpg, jpeg, png, webp, gif, bmp). Other AI pipelines may accept different formats per their service rules.