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
| Field | Type | Description |
|---|---|---|
message_idRequired | string | Message id, as returned by mail.read_list. |
account_handle | string | Which configured mailbox to read. |
folder | string | Folder that holds the message. |
end_user_id | string | Optional end-user scope. |
Output fields
The fields in data when status is success.
| Field | Type |
|---|---|
id | string |
account | object |
provider | string |
folder | string |
subject | string |
from | object |
to | array of object |
cc | array of object |
snippet | string |
received_at | string |
unread | boolean |
has_attachments | boolean |
thread_id | string |
body_text | string |
body_html | string |
attachments | array of object |
attachments_over_limit | object |
uid_validity | integer |
untrusted | boolean |
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())// Node.js 18 or newer, in an ES module.
const response = await fetch("https://toolsprimitives.uk/v1/tools/mail.read_get/invoke", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.HEELO_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
input: {
"message_id": "MESSAGE_ID"
},
}),
signal: AbortSignal.timeout(120_000),
});
if (!response.ok) throw new Error(`HTTP ${response.status}`);
console.log(await response.json());