Get your API key
API reference

Mailbox

The Mailbox endpoints.

Auth: App password · Base URL: https://api.mailkite.dev

Endpoints

Each row expands to its request and response schema. The address bar follows along, so any endpoint can be linked to directly.

GET /api/mailbox/messages List a mailbox's messages, newest first. Authenticated with an app password granting `api` — this is how an agent reads its own inbox without an IMAP client.

List a mailbox's messages, newest first. Authenticated with an app password granting `api` — this is how an agent reads its own inbox without an IMAP client.

Response body

mailbox-messages-response.json

One page of a mailbox's messages, newest first. Read with an app password that grants `api`.

FieldTypeNotes
messages req object[]The page, newest first.
messages[].uid req numberStable per-mailbox id — also the IMAP UID, so both protocols name a message the same way.
messages[].flags req stringSpace-separated IMAP flags WITHOUT the leading backslash, e.g. `Seen Flagged`.
messages[].internaldate req stringWhen the message arrived, ISO-8601.
messages[].from_addr req stringEnvelope sender.
messages[].to_addr req stringThe mailbox address this copy was delivered to.
messages[].subject req string · nullSubject line, null when absent.
messages[].size req number · nullRaw message size in bytes, when known.
nextBefore req number · nullCursor for the next page — pass as `before`. Null when this is the last page.
GET /api/mailbox/messages/:uid/raw Fetch one message's raw RFC822 bytes from a mailbox. Same app password auth as the list.

Fetch one message's raw RFC822 bytes from a mailbox. Same app password auth as the list.

No request body. The response is JSON; its exact shape isn't schema'd yet — tell us if you need it pinned down.

POST /api/mailbox/messages/:uid/flags Replace a message's IMAP flags (e.g. mark it `Seen`). Flags set here are the same ones an IMAP client sees.

Replace a message's IMAP flags (e.g. mark it `Seen`). Flags set here are the same ones an IMAP client sees.

Request body

set-mailbox-flags-request.json
FieldTypeNotes
flags req stringThe complete flag set to store, space-separated and WITHOUT leading backslashes (e.g. `Seen Flagged`). This replaces the message's flags rather than merging.

Response body

ok-response.json

The uniform acknowledgement for deletes and other actions with nothing else to report.

FieldTypeNotes
ok req trueAlways true — a non-2xx error body is returned otherwise.