Skip to content

Docs / All tools / Loop III: Assistant

assistant.invoice.approve

After approval, add a calendar payment reminder, create a Notion record, and generate a PDF receipt.

Charged by the tools it calls. Calendar event 5, notion.create_page 5, doc.render_pdf 25.

Example prompt

Send this to your AI app when Heelo is connected:

The invoice values are correct. Approve the run and add the payment reminder.

Input fields

FieldTypeDescription
run_idRequiredstringThe run id that start returned (inv_…).
end_user_idstringThe end user the run was started for.
review_digestRequiredstringThe review_digest that status returned with the review.
approved_byRequiredstringWho approves: the name of the person, or of the agent.
correctionsobjectField name → corrected value: text, a number, or for line_items a list of rows. Typed and checked like extracted values (doc.review_decide); the checks run again, and the writes use the typed values.
confirmbooleantrue writes; without it the answer says what would be written.

Code

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

import os
import requests

response = requests.post(
    "https://toolsprimitives.uk/v1/tools/assistant.invoice.approve/invoke",
    headers={"Authorization": f"Bearer {os.environ['HEELO_API_KEY']}"},
    json={"input": {
        "run_id": "RUN_ID",
        "review_digest": "REVIEW_DIGEST",
        "approved_by": "APPROVED_BY",
    }},
    timeout=120,
)
response.raise_for_status()
print(response.json())