Skip to main content
Commune groups related emails into threads automatically using email headers and routing tokens. Your agent can list threads, read messages, and manage triage metadata (status, tags, assignment).

List threads

Parameters

At least one of inbox_id or domain_id is required.

Response

Thread object


Get thread messages

Read all messages in a conversation, ordered chronologically.

Parameters

Response

Returns an array of Message objects.

Thread triage

Commune provides built-in triage primitives — status, tags, and assignment — so your agent can organize conversations without an external ticketing system.

Get triage metadata

Set thread status

Valid statuses: open, needs_reply, waiting, closed

Add tags

Tags are additive — existing tags are preserved.

Remove tags

Assign a thread

Assign to an agent or user identifier. Pass null to unassign.

Triage metadata object

How threading works

Commune resolves threads using a priority chain:
  1. Plus-address routing token — Opaque HMAC tokens in Reply-To headers (e.g., inbox+r.dGhyZWFk.sig@domain.com) map directly to a thread ID
  2. Database lookup — SMTP In-Reply-To and References headers are matched against stored message IDs
  3. SMTP header fallback — Standard email threading headers are used if no match is found
  4. New thread — If no existing thread matches, a new one is created
This means your agent’s replies are always correctly threaded, even when email clients rewrite headers.

What’s next?

Messages

Send emails and list messages with full parameter reference.

Search

Search across threads by subject, content, or semantic meaning.

Webhooks

Receive inbound emails and reply within the correct thread.

Structured Extraction

Automatically extract structured data from emails in threads.
Last modified on March 19, 2026