Messages & threads
Read incoming email as structured messages, follow conversations as threads, and reply from the same address.
Every email that reaches one of your inboxes becomes a structured message — parsed sender, subject, both bodies, attachment metadata — with no raw MIME to handle. A message that draws replies becomes a thread, so the whole conversation stays in one place.
You can work with inbound mail two ways: subscribe to the message.received webhook and act the moment mail arrives, or pull messages on demand with the endpoints on this page. Every read uses the messages:read scope.
List messages
GET /v1/messages returns messages newest-first — across every inbox, or filtered to one.
| Parameter | What it does |
|---|---|
inboxId | Only messages on one inbox. |
threadId | Only messages in one thread. |
direction | inbound or outbound. |
channel | Only one channel: email, a2a, telegram, slack, or voice. |
limit | Page size, 1–100. Defaults to 25. |
cursor | The pagination.nextCursor from the previous page — the pattern is on Paging through lists. |
direction=outbound with no channel filter returns the outbound send ledger — per-recipient delivery status, bounces, and complaints — described in Track delivery. That view honors inboxId and limit; cursor or threadId on it is a 400. Add an explicit channel, e.g. channel=email&direction=outbound, to page the message shape shown here.
Fetch one message
List rows carry a textPreview. Fetch a single message for the full record — both bodies, parsed addresses, and attachment metadata.
Message fields
| Field | What it is |
|---|---|
id | Stable message identifier. |
channel | How the message traveled — email, a2a, telegram, slack, or voice (an answered phone call). |
inboxId / threadId | The inbox that handled the message, and the conversation it belongs to. |
direction | inbound or outbound. |
status | received on inbound mail; sent on your outbound copies. |
from | Parsed sender: { "address", "name" }. |
to / cc / bcc | Recipient addresses. |
subject | The subject line. |
textPreview | The first 160 characters of the text body — enough to scan a list. |
hasHtml / hasAttachments | Whether the full record carries an HTML body or attachments. |
textBody / htmlBody | The full bodies, returned when you fetch one message. |
attachments | Attachment metadata: id, filename, contentType, sizeBytes. |
structured / extractionStatus | Typed extraction results on inboxes with a schema — see Extract structured data. |
channelMetadata | Channel-specific metadata; its fields depend on the channel. |
receivedAt / createdAt | Timestamps. |
Follow a conversation with threads
A thread is one conversation on an inbox: a message and the replies it collected. GET /v1/threads lists threads by most recent activity; GET /v1/threads/{threadId} returns one thread with its messages oldest-first, up to 100.
Reply in a thread
When you email someone and they answer, the reply lands in the thread of the message it answers — Dairo connects it through standard email reply headers. To answer, send from the same inbox with replyToMessageId set to the message you are answering: Dairo sets the reply headers from it and files your reply in the same thread. Keep the subject with a Re: prefix so the recipient's mail client keeps the conversation together.
A replyToMessageId you cannot see is a 404. To reply to mail outside Dairo, pass the raw inReplyTo Message-ID (and optionally references) instead.
Handle attachments
Files on inbound mail arrive as metadata only; when you need one, you mint a short-lived download link or fetch the bytes. Inbound files come from arbitrary senders, so treat them as untrusted — the endpoints and the handling rules live on Attachments.
Delete messages
POST /v1/messages/batch-delete removes up to 1,000 messages in one call and needs the messages:read scope. The response reports per-id results — an id you don't own is returned under failed and never aborts the rest of the batch.
Next steps
- Wait for one-time codes — resolve a sign-up or reset flow the moment its email arrives.
- Agent-to-agent messages — the
a2achannel between Dairo accounts, same message shape. - Build a support inbox agent — a full receive, process, and reply flow.