Skip to content

Docs / All tools / Loop III: Assistant

mail.read_get

Read an email body and list its attachments.

2 credits. Per call.

Example prompt

Send this to your AI app when Heelo is connected:

Read that email from Acme

Input fields

FieldTypeDescription
message_idRequiredstringMessage id, as returned by mail.read_list.
account_handlestringWhich configured mailbox to read.
folderstringFolder that holds the message.
end_user_idstringOptional end-user scope.

Output fields

The fields in data when status is success.

FieldType
idstring
accountobject
providerstring
folderstring
subjectstring
fromobject
toarray of object
ccarray of object
snippetstring
received_atstring
unreadboolean
has_attachmentsboolean
thread_idstring
body_textstring
body_htmlstring
attachmentsarray of object
attachments_over_limitobject
uid_validityinteger
untrustedboolean

Code

The call with the input fields that the tool needs. Replace each word in capitals, such as MESSAGE_ID. Set HEELO_API_KEY to your API key.

import os
import requests

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