agentlyleads docs
Inbox API

The Thread object

The Inbox API reads and triages the team's shared email inbox, the one on the Emails page. It works on conversations, not single messages: every message that shares a provider thread belongs to one conversation, and a message with no thread is a conversation of its own.

Each conversation has a threadKey. Use it with every Inbox API endpoint. Wherever a threadKey is accepted you can also pass the ID of any message in the conversation, which is handy when you only have a message ID from GET /api/v1/emails.

Places and states

A conversation is in one folder (a place) and carries state on top of that:

FolderWhat is in it
inboxConversations with at least one received message that are not archived or snoozed
snoozedConversations hidden until a later time
archivedConversations archived out of the Inbox
sentConversations you have sent mail in
draftsConversations holding an unsent draft
allEverything except spam, trash and bulk
bulkMachine mail: newsletters, reports, autoresponders
spamMarked as spam by a person
trashMoved to the trash

Spam, trash and bulk are held apart. A conversation in one of them appears only there.

Ownership and open or closed are not folders. They are filters you add to a folder, so "unassigned mail in the Inbox" is folder=inbox&assignee=unassigned.

Archive is not close

Archive takes a conversation out of the Inbox until the next reply arrives, which brings it back. Closed is the team's shared "handled" state and stays closed when new mail arrives.

Fields

FieldTypeNotes
threadKeystringThe conversation's stable key
latestMessageIdstringThe newest message. Changes when mail arrives
subjectstringThe first message's subject
snippetstringShort plain-text preview of the latest message
messageCountinteger
unreadCountintegerReceived messages nobody has opened in the app
lastAtstring (ISO 8601)Latest activity
latestDirectionstringINBOUND or OUTBOUND
statestringOPEN or CLOSED
closedAtstring or null
assigneeobject or null{ id, name }. Null means Unassigned
spamboolean
trashedboolean
archivedboolean
snoozedUntilstring or null
bulkbooleanMachine mail
hasDraftboolean
tagsarray{ id, name, color }. The same tags contacts and deals use
mailboxobject or nullThe connected mailbox the conversation lives in: { id, address, label }
contact / leadobject or nullThe CRM record the conversation belongs to
unmatchedSenderobject or nullWho wrote in, when there is no contact or lead
replyClassstring or nullClassification of the latest received message, such as INTERESTED
campaign / dealobject or null{ id, name } when the conversation is filed under one
agingobjectSee below

Aging

aging answers "is this waiting on us, and for how long". It is worked out from the messages each time you read it.

FieldNotes
waitingOnUstrue when the conversation is open and the customer's message is the latest one
waitingSinceWhen the first unanswered message in the current run arrived. Three follow-ups over two days is a two-day wait
waitingMinsMinutes since waitingSince
overduePast the workspace's first-response target. Always false when no target is set

Example

{
  "threadKey": "18c2f0a9b1d4e5f6",
  "latestMessageId": "cmq5mail0alk34567890",
  "subject": "Pricing for 500 units",
  "snippet": "Hi, could you send pricing for 500 units delivered to Toronto?",
  "messageCount": 3,
  "unreadCount": 1,
  "lastAt": "2026-09-27T14:02:00.000Z",
  "latestDirection": "INBOUND",
  "state": "OPEN",
  "closedAt": null,
  "assignee": { "id": "cmq1user0alk34567891", "name": "Rita Cole" },
  "spam": false,
  "trashed": false,
  "archived": false,
  "snoozedUntil": null,
  "bulk": false,
  "hasDraft": false,
  "tags": [{ "id": "cmq7tag00alk34567890", "name": "Pricing", "color": null }],
  "mailbox": { "id": "cmq8acct0alk34567890", "address": "sales@example.com", "label": "Sales" },
  "contact": { "id": "cmq2cont0alk34567891", "name": "Ann Lee", "email": "ann@customer.co" },
  "lead": null,
  "unmatchedSender": null,
  "replyClass": "INTERESTED",
  "campaign": null,
  "deal": null,
  "aging": { "waitingOnUs": true, "waitingSince": "2026-09-27T14:02:00.000Z", "waitingMins": 42, "overdue": false }
}

Scopes

ScopeEndpoints
read:emailsListing and reading conversations, reading comments, the summary and the assignee list
write:emailsAssign, close and reopen, spam, trash, archive, snooze, tags, and adding comments

None of these endpoints send mail. Replies are drafted with POST /api/v1/emails/{id}/reply.

On this page