Skip to content

Docs / All tools / Loop I: Distribution

inbound.stats

View campaign visits, visitors by channel and contact, lead conversion rates, and top pages.

0 credits. Free: reads Heelo's own records.

Example prompt

Send this to your AI app when Heelo is connected:

Show inbound stats for campaign seq_2026q4

Input fields

FieldTypeDescription
site_idRequiredstringSite to report on
campaignRequiredstringCampaign id, e.g. 'seq_2026q4'
sincestringISO start of window (alias: from)
untilstringISO end of window (alias: to)
include_visitsbooleanAlso return the campaign's visit rows exactly as stored (every stored column, at most 50, newest first) and the stored column names — to check what visit data is kept, e.g. that no raw IP is.

Output fields

The fields in data when status is success.

FieldType
visitsinteger
uniquesinteger
by_channelobject
capturesinteger
capture_ratenumber
by_contactarray of object
top_pagesarray of object
stored_visitsarray of object
stored_visit_columnsarray of string

Code

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

import os
import requests

response = requests.post(
    "https://toolsprimitives.uk/v1/tools/inbound.stats/invoke",
    headers={"Authorization": f"Bearer {os.environ['HEELO_API_KEY']}"},
    json={"input": {
        "site_id": "SITE_ID",
        "campaign": "CAMPAIGN",
    }},
    timeout=120,
)
response.raise_for_status()
print(response.json())