Sending attachments
To send an email with attachments, usemultipart/form-data instead of JSON:
- Maximum 25 MB total per email (provider limit)
- Multiple files: repeat the
attachmentsfield (curl) or--attachflag (CLI) - JSON requests without attachments continue to work as before
Receiving attachments
When an inbound email includes attachments, OpenMail stores them, extracts readable text, and provides signed download URLs.How it works
- Email arrives with attachments
- We upload each file to secure storage
- Text is extracted automatically based on file type
- Attachment metadata — including extracted text — is included in the webhook payload and message responses
Text extraction
OpenMail automatically extracts readable text from common attachment types so your agent can read the content directly from the webhook payload or API response, without downloading and parsing files.| File type | Examples |
|---|---|
| Invoices, receipts, contracts | |
| Images | Scanned documents, screenshots |
| Office docs | .docx, .xlsx, .pptx, .odt |
| CSV / TSV | Spreadsheets, data exports |
| Plain text | .txt, .md, .json, .html, .xml, .yaml, .log |
parsedText field when extraction succeeds:
extractionMethod field tells you how the text was extracted: pdf, ocr, office, csv, or text. If extraction failed or the file type is unsupported, parsedText is omitted and extractionMethod indicates the reason (e.g. unsupported, pdf_error, skipped_too_large).
Limits
- Files larger than 10 MB are skipped for extraction
- Extracted text is capped at 50,000 characters per attachment
- Unsupported binary formats (video, audio, archives) return
extractionMethod: "unsupported"
Downloading attachments
Each attachment includes aurl field in the message response:
302 redirect to a signed URL that expires in 15 minutes.
On-demand text extraction
For attachments that were stored before text extraction was available, or to re-extract text, use the/text endpoint:
Size limits
- Maximum attachment size is determined by the email provider (typically 25 MB per email)
- Attachment download URLs expire after 15 minutes