assistant. invoice. start
Read a PDF invoice attached to an email, extract and check its fields, and wait for review.
Charged by the tools it calls. mail.read_get 2, mail.read_attachment 2, doc.extract_fields 25.
Example prompt
Send this to your AI app when Heelo is connected:
Process the latest invoice e-mail from Acme: check the PDF and add a payment reminder to my Outlook calendar after I approve.
Input fields
| Field | Type | Description |
|---|---|---|
account_handle | string | The mail account to read (mail.read's account_handle); the default when omitted. |
message_id | string | The invoice email's id from mail.read_list. Give this or subject. |
subject | string | Text in the invoice email's subject; the newest match is used. Give this or message_id. |
attachment_id | string | The invoice attachment's id, from mail.read_get's attachments (not its file name); needed only when the email has two PDFs. |
folder | string | The mailbox folder. |
calendar | "outlook" | "google" | "none" | Which connected calendar gets the payment event; none writes no event. |
timezone | string | IANA timezone of the event, e.g. America/Chicago. Leave it out to use the calendar's own. A Google Calendar places the event in its own timezone, so another one is refused. |
notion_parent | string | The Notion page id or URL to create the record under; none writes no page. |
end_user_id | string | Which of your end users the mailbox belongs to. |
include_confidence | boolean | Also show each field's confidence score in the review. Off by default: compare the values with the invoice (invoice_document in status) instead. |
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/assistant.invoice.start/invoke",
headers={"Authorization": f"Bearer {os.environ['HEELO_API_KEY']}"},
json={"input": {
"subject": "Invoice",
}},
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/assistant.invoice.start/invoke", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.HEELO_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
input: {
"subject": "Invoice"
},
}),
signal: AbortSignal.timeout(120_000),
});
if (!response.ok) throw new Error(`HTTP ${response.status}`);
console.log(await response.json());