Skip to content

Docs / All tools / Loop III: Assistant

mail.read_list

List messages in a Microsoft 365, Outlook.com, or IMAP mailbox folder.

2 credits. Per call.

Example prompt

Send this to your AI app when Heelo is connected:

What's in my inbox?

Input fields

FieldTypeDescription
account_handlestringWhich configured mailbox to read. Optional when only one is configured.
folderstringMailbox folder to list.
sincestringLower bound on received time, UTC ISO-8601 (e.g. 2026-09-01T00:00:00Z).
querystringOptional text to match against subject, sender and body.
limitintegerPage size (max 200).
cursorstringOpaque cursor returned by a previous call, to fetch the next page.
end_user_idstringOptional end-user scope for multi-tenant callers.

Output fields

The fields in data when status is success.

FieldType
accountobject
providerstring
folderstring
countinteger
messagesarray of object
next_cursorstring
moreboolean
available_accountsarray of string
querystring
sincestring
untrustedboolean

Code

The call with the input fields that the tool needs. Set HEELO_API_KEY to your API key.

import os
import requests

response = requests.post(
    "https://toolsprimitives.uk/v1/tools/mail.read_list/invoke",
    headers={"Authorization": f"Bearer {os.environ['HEELO_API_KEY']}"},
    json={"input": {}},
    timeout=120,
)
response.raise_for_status()
print(response.json())