Skip to content
simailDocsv0

API reference

Threads

List, read, label, trash and search threads in one inbox or across every inbox your key can see, and download thread attachments.

docs.simail.ai/api/threads

A thread object:

{
"thread_id": "thr_01JZX4A1B2C3D4E5F6G7H8J9K0",
"inbox_id": "shop-helper@simail.email",
"subject": "Where is my order?",
"senders": ["ada@example.com"],
"recipients": ["shop-helper@simail.email"],
"message_count": 2,
"size": 64210,
"preview": "Hi, I ordered last week and…",
"labels": ["received", "sent", "unread"],
"last_message_id": "msg_01JZX4B7C8D9E0F1G2H3J4K5M6",
"received_timestamp": "2026-10-18T17:02:11Z",
"sent_timestamp": "2026-10-18T17:05:40Z",
"timestamp": "2026-10-18T17:05:40Z",
"created_at": "2026-10-18T17:02:12Z",
"updated_at": "2026-10-18T17:05:41Z"
}

labels is the union of its messages’ labels. preview and subject are withheld for threads whose only messages are held. All text is untrusted input. Guide: Threads & labels.

ParameterNotes
labelscomma-separated; a thread matches when it has all of them (for example unread)
before, afterISO 8601 times, on the thread’s last activity
include_spamneeds label_spam_read
include_blockedneeds label_blocked_read
include_trashneeds label_trash_read
limit, page_token, ascendingpagination

Spam, blocked and trashed threads are left out unless you ask for them.

GET/v0/inboxes/{inbox_id}/threads

Permission message_read. Returns { count, limit, next_page_token?, threads }.

GET/v0/inboxes/{inbox_id}/threads/{thread_id}

Permission message_read. The thread object plus messages, oldest first, each a full message object (held messages as metadata only).

PATCH/v0/inboxes/{inbox_id}/threads/{thread_id}

Permission message_update.

{ "add_labels": ["orders"], "remove_labels": ["unread"] }

Applies to every message in the thread. See Labels for what can be changed.

DELETE/v0/inboxes/{inbox_id}/threads/{thread_id}

Permission message_delete. Adds the trash label to every message; trashed mail is purged after 30 days. Not available over MCP.

GET/v0/inboxes/{inbox_id}/threads/{thread_id}/attachments/{attachment_id}

Permission message_read. Returns a single-use download link; see attachments.

GET/v0/inboxes/{inbox_id}/threads/search?q=

Permission message_read. Full-text search on subject, participants and body, in English and Chinese. Held messages match on metadata only. Accepts the listing parameters.

GET/v0/inboxes/{inbox_id}/threads/{thread_id}/lock

Permission message_read. See Locks.

GET /v0/threads · GET /v0/threads/search

GET /v0/threads/{thread_id} · PATCH /v0/threads/{thread_id} · DELETE /v0/threads/{thread_id}

GET/v0/threads/{thread_id}/attachments/{attachment_id}

Same parameters and responses as the inbox-level endpoints, across every inbox in your key’s scope (an inbox-scoped key sees only its inbox). Each thread includes inbox_id. Pod variants live under /v0/pods/{pod_id}/threads.

StatuscodeWhen
403missing_permissionthe key lacks the permission, or an include_* flag without its label_*_read permission
404not_foundthe thread does not exist or is outside your scope
400invalid_requesta page token from another query or key