All endpoints

List messages across inboxes

GEThttps://anjal.app/v1/messages

One list across every inbox the key can see (tenant, workspace, inbox or teammate scope). ?labels=a,b returns messages carrying every label; with group=thread it matches whole threads (a thread matches when any of its messages carries the labels) and each row carries the thread's labels.

Query parameters

folder
"inbox" | "sent" | "starred" | "archived" | "spam" | "trash"
group
"thread"

`thread` returns one row per thread (its latest message).

inboxId
string
labels
string

Comma-separated labels, e.g. `needs-review,billing`. Only results carrying every one are returned.

limit
integer
offset
integer

Responses

200application/jsonOK
messages
object[]
id
string

format: uuid

direction
"inbound" | "outbound"

enum: "inbound" | "outbound"

from
string
to
string
subject
string
plainBody
string
htmlBody
string
isRead
boolean
threadId
string

format: uuid

messageIdHeader
string
inReplyTo
string
receivedAt
string

format: date-time

labels
string[]

Lowercase labels on this message.

isSpam
boolean

Flagged by the spam filter. Spam is left out of lists unless `includeSpam=true`.

deliveryStatus
"delivered" | "bounced" | "complained" | "rejected" | null

Outbound only. `delivered` means the recipient's mail server accepted it (not a guarantee of inbox placement). Null until known.

enum: "delivered" | "bounced" | "complained" | "rejected" | null

deliveredAt
string

When the recipient's mail server accepted the message (outbound only).

format: date-time

firstOpenedAt
string

Time of the first open (outbound sends with `trackOpens: true` only). NULL until the first open. Opens are a hint, not proof: Apple Mail Privacy Protection fetches images on delivery, and clients that block images never report an open.

format: date-time

lastOpenedAt
string

Most recent open event. Updates on every open.

format: date-time

openCount
integer

Total opens. Subject to the same caveats as the timestamps.

default: 0

firstClickedAt
string

Timestamp of the first recipient link-click. Reliable signal of engagement (unlike opens, click events are not Apple-MPP-poisoned). NULL until the first click.

format: date-time

lastClickedAt
string

format: date-time

clickCount
integer

default: 0

attachments
object[]
id
string

format: uuid

filename
string
contentType
string
sizeBytes
integer
inline
boolean

Present and true when `htmlBody` embedded this attachment as an inline image and `?inlineImages=refs` replaced it with `attachment:<id>`.

Authentication

Send your API key in the X-API-Key header (or Authorization: Bearer <key>). Any prefix accepted by this endpoint — tk_, wk_, ak_, or sa_ — is documented in the key prefix table.