Skip to main content
Files on inbound mail arrive as metadata — filename, content type, size — never as inline bytes. When you need the file, mint a short-lived signed link you can hand to a browser or another service, or download the bytes directly. Every attachment read uses the messages:read scope.
Treat every inbound attachment as untrusted. Received files come from arbitrary senders and can carry malware, exploits, or phishing content. A Dairo-hosted download link only means Dairo serves the link — it is not a safety judgment about the file. Never auto-open, auto-execute, or feed attachment bytes into a shell, parser, or renderer. Scan with antivirus, enforce content-type and size limits, process in a sandbox, and require human review before opening files you didn’t create.

Read attachment metadata

Attachment ids come from the attachments array on a fetched message. Fetch one to get its filename, content type, size, and the message it belongs to.
The disposition is attachment for a normal file or inline for one referenced from the HTML body (an embedded image, say).

Get the file

Three endpoints serve the file, each for a different consumer: On /url and /link, expiryHours sets how long the links stay valid — an integer from 1 to 168 (one week). Omit it and the links last five minutes.
Dairo scans inbound files. Your own authenticated reads work while a scan is still running, but a file the scan flags is withheld — requests for it return 403. The shareUrl is a human-friendly download page — handy when you want to hand a file to someone in an email. Dairo never inserts links into your mail for you: mint the link, then place it in your text or html deliberately. Two things to keep in mind when sharing inbound files onward:
  • A share link only starts serving an inbound file after it passes Dairo’s malware scan; until then the page withholds the download.
  • Sharing a file onward means vouching for a file you didn’t author. The page is hosted by Dairo, but the file behind it is whatever the sender attached — confirm it’s safe before distributing the link.

Next steps

  • Send an email — attach files to outbound mail.
  • Share links — the same short-lived links over files in your own storage buckets.
  • API reference — every endpoint, with copy-paste requests.