Reference

Folders

Folders are the mailbox’s containers such as Inbox, Sent and Drafts. List them to get folder ids and counts.

TuskMail API: Folders

List folders

GET/v1/folders
curl "https://api.tuskmail.africa/v1/folders" \
  -H "X-API-Key: $TK_API_KEY" \
  -u "$MAILBOX_EMAIL:$APP_PASSWORD"
200 OK
{
  "data": [
    { "id": "b1", "name": "Inbox", "role": "inbox", "total": 140, "unread": 6 },
    { "id": "b2", "name": "Sent", "role": "sent", "total": 312, "unread": 0 }
  ]
}
NameTypeDescription
idstringFolder id. Accepted anywhere a folder is requested.
namestringDisplay name.
rolestring | nullSystem role such as inbox, sent, drafts, junk or trash. Custom folders have no role.
total / unreadintegerMessage counts.

Wherever the API takes a folder, you can pass a role name (inbox, sent, drafts, junk, trash) or a folder id.