Skip to content

Docs / All tools / Loop III: Assistant

doc.review_decide

Approve extracted data with optional corrections, or reject it.

0 credits. Free. The user decides, or the user's agent when the user allows it.

Example prompt

Send this to your AI app when Heelo is connected:

The total is wrong: it is $1,393.20. Approve the extracted values with that correction.

Input fields

FieldTypeDescription
review_idRequiredstringThe review.id that doc.extract_fields returned.
decisionRequiredstringapprove | reject
decided_byRequiredstringWho decided: the name of the person, or of the agent.
correctionsobjectField name -> the right value, for an approval. Typed and checked like extracted values.
notestringWhy, in a sentence.
end_user_idstringThe end user the extraction was made for, if any.

Output fields

The fields in data when status is success.

FieldType
review_idstring
statusstring
decided_bystring
decided_atstring
use_bystring
valuesobject
checksarray of object
answerstring

Code

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

import os
import requests

response = requests.post(
    "https://toolsprimitives.uk/v1/tools/doc.review_decide/invoke",
    headers={"Authorization": f"Bearer {os.environ['HEELO_API_KEY']}"},
    json={"input": {
        "review_id": "REVIEW_ID",
        "decision": "approve",
        "decided_by": "DECIDED_BY",
    }},
    timeout=120,
)
response.raise_for_status()
print(response.json())