outbound. mail. consent_ record
Record the lawful basis for emailing a contact.
0 credits. Free: compliance step.
Example prompt
Send this to your AI app when Heelo is connected:
Record that [email protected] gave express consent through our sign-up form on November 3, 2026.
Input fields
| Field | Type | Description |
|---|---|---|
contact_idRequired | string | The contact's id, from outbound.mail.contact_add or contact.resolve. |
lawful_basisRequired | "express" | "implied" | "legitimate_interest" | The basis for mailing this person. A CA contact needs express or implied (implied lasts two years from obtained_at); a GB individual needs express. |
sourceRequired | string | Where the consent came from, for example 'signup form on example.com'. |
evidence_urlRequired | string | Where the evidence of the consent is kept: a URL or a reference. |
obtained_atRequired | string | When the person agreed: ISO-8601 with a timezone, for example 2026-10-14T09:30:00Z. Not in the future. |
expires_at | string | When the consent ends: ISO-8601 with a timezone, after obtained_at. Leave it out for no end. |
subscriber_type | "individual" | "corporate" | "unknown" | Also sets the contact's subscriber type. Leave it out to keep the stored one. |
Code
The call with the input fields that the tool needs. Replace each word in capitals, such as CONTACT_ID. Set HEELO_API_KEY to your API key.
import os
import requests
response = requests.post(
"https://toolsprimitives.uk/v1/tools/outbound.mail.consent_record/invoke",
headers={"Authorization": f"Bearer {os.environ['HEELO_API_KEY']}"},
json={"input": {
"contact_id": "CONTACT_ID",
"lawful_basis": "express",
"source": "SOURCE",
"evidence_url": "https://example.com",
"obtained_at": "2026-12-01T09:00:00Z",
}},
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/outbound.mail.consent_record/invoke", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.HEELO_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
input: {
"contact_id": "CONTACT_ID",
"lawful_basis": "express",
"source": "SOURCE",
"evidence_url": "https://example.com",
"obtained_at": "2026-12-01T09:00:00Z"
},
}),
signal: AbortSignal.timeout(120_000),
});
if (!response.ok) throw new Error(`HTTP ${response.status}`);
console.log(await response.json());