Skip to content

Docs / All tools / Loop IV: Validation

validation.run.approve_contacts

Record approval of the contacts and the lawful basis for outreach so sending can begin.

Charged by the tools it calls. 5 per e-mail sent.

Example prompt

Send this to your AI app when Heelo is connected:

I checked the contacts of my validation run that you showed me. Approve them. I will tell you the lawful basis.

Input fields

FieldTypeDescription
run_idRequiredstring
versionRequiredstringdata.review.version from validation.run.status, unchanged
approved_byRequiredstringYour user's name: the person who said yes
lawful_basisRequiredstringYour user's choice, one of data.review.content.lawful_bases.allowed (express, implied, legitimate_interest); never choose it for them
sourceRequiredstringWhere the lawful basis comes from, your user's words

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/validation.run.approve_contacts/invoke",
    headers={"Authorization": f"Bearer {os.environ['HEELO_API_KEY']}"},
    json={"input": {
        "run_id": "RUN_ID",
        "version": "VERSION",
        "approved_by": "APPROVED_BY",
        "lawful_basis": "LAWFUL_BASIS",
        "source": "SOURCE",
    }},
    timeout=120,
)
response.raise_for_status()
print(response.json())