Reference

List and get messages

List messages in a folder with filters and paging, or fetch one message to get its full body and bcc.

TuskMail API: List and get messages

The message object

Message (list item)
{
  "id": "Mabc123",
  "thread_id": "Tabc123",
  "folder_ids": ["b1"],
  "from": [{ "name": "Amina Wanjiru", "email": "[email protected]" }],
  "to": [{ "name": "", "email": "[email protected]" }],
  "cc": [],
  "subject": "Quote request for Q4 deliveries",
  "received_at": "2025-01-15T18:45:00Z",
  "preview": "Hello, could you share your latest rates...",
  "is_read": false,
  "is_starred": false,
  "has_attachment": true,
  "size": 48213,
  "attachments": [
    { "attachment_id": "B987", "name": "rates.pdf", "type": "application/pdf", "size": 40960 }
  ]
}
NameTypeDescription
idstringMessage id.
thread_idstringConversation thread id.
folder_idsstring[]Folders the message is in.
from / to / ccaddress[]Arrays of { "name", "email" }.
subjectstringSubject line.
received_atstringISO 8601 timestamp.
previewstringShort plain-text preview.
is_read / is_starredbooleanFlags.
has_attachmentbooleanWhether the message has attachments.
sizeintegerSize in bytes.
attachmentsobject[]attachment_id, name, type, size.
bcc, html, text, message_idvariousOnly on the single-message GET.

List messages

GET/v1/messages
NameTypeDescription
folderstringA role (inbox, sent, drafts, junk, trash) or a folder id. Omit to search all folders.
qstringSearch text.
unreadbooleanOnly unread messages.
starredbooleanOnly starred messages.
limitinteger1 to 100. Default 25.
positionintegerOffset for paging. Default 0.
curl "https://api.tuskmail.africa/v1/messages?folder=inbox&unread=true&limit=10" \
  -H "X-API-Key: $TK_API_KEY" \
  -u "$MAILBOX_EMAIL:$APP_PASSWORD"
200 OK
{
  "data": [
    {
      "id": "Mabc123",
      "thread_id": "Tabc123",
      "folder_ids": ["b1"],
      "from": [{ "name": "Amina Wanjiru", "email": "[email protected]" }],
      "to": [{ "name": "", "email": "[email protected]" }],
      "cc": [],
      "subject": "Quote request for Q4 deliveries",
      "received_at": "2025-01-15T18:45:00Z",
      "preview": "Hello, could you share your latest rates...",
      "is_read": false,
      "is_starred": false,
      "has_attachment": true,
      "size": 48213,
      "attachments": [
        { "attachment_id": "B987", "name": "rates.pdf", "type": "application/pdf", "size": 40960 }
      ]
    }
  ],
  "total": 6,
  "limit": 10,
  "position": 0,
  "next_position": null
}

See Pagination for paging through large result sets.

Retrieve a message

GET/v1/messages/{id}
NameTypeDescription
idrequiredstringMessage id, in the path.
mark_readbooleanIf true, the message is also marked read.
curl "https://api.tuskmail.africa/v1/messages/Mabc123?mark_read=true" \
  -H "X-API-Key: $TK_API_KEY" \
  -u "$MAILBOX_EMAIL:$APP_PASSWORD"
200 OK (additional fields)
{
  "id": "Mabc123",
  "subject": "Quote request for Q4 deliveries",
  "bcc": [],
  "text": "Hello, could you share your latest rates...",
  "html": "<p>Hello, could you share your latest rates...</p>",
  "message_id": "<[email protected]>",
  "...": "all other fields as in the message object"
}

An unknown id returns 404 not_found.