Threads

A thread is created for the first message and reused when a later message matches it. Matching order for inbound mail: the In-Reply-To and References headers against messages in the same inbox, then the normalised subject (prefixes like Re: and Fwd: removed). Replies sent through the API always keep their thread. A forward starts a new thread.

curl "$BASE_URL/v0/threads?limit=20" -H "Authorization: Bearer $API_KEY"
curl "$BASE_URL/v0/inboxes/$INBOX_ID/threads/$THREAD_ID" -H "Authorization: Bearer $API_KEY"

List endpoints exist at organization, pod and inbox level. A thread summary has senders, recipients, subject, preview, message_count, last_message_id, aggregate labels and timestamps. GET .../threads/:thread_id adds the messages array.

Search: GET /v0/threads/search?q=... (also under pods and inboxes).

PATCH with add_labels or remove_labels changes labels on every message in the thread. DELETE returns 204. The dashboard lists threads and shows one with its messages and a reply box; renaming, labelling and deleting threads are API only.