Skip to content

Docs / All tools / Loop I: Distribution

loop1.run.start

Start a distribution run that prepares a card, a page, and posts for each platform. Publishing follows approval.

Charged by the tools it calls. inbound.page.publish 25. The posts are charged at loop1.run.approve.

Example prompt

Send this to your AI app when Heelo is connected:

Prepare a launch post about our new CSV import for LinkedIn and X, with a share image and a landing page. Show me the posts before they go out.

Input fields

FieldTypeDescription
messageRequiredstringThe one message to adapt to each channel
channelsRequiredarray of stringbluesky, linkedin, twitter (or x), instagram, reddit. Reddit posts only when it is named.
pageRequiredobject
cardobjectRequired for instagram; its image is the page's og:image
redditobjectRequired when reddit is a channel
campaignstringThe stats key. Default: the run id. One open run for each campaign
site_idstringOne of your Loop I site ids
acknowledge_unknownbooleanSet to true only after a person checked the accounts. start refuses a campaign whose last run has a channel with an unknown outcome (it may have posted); with this set, it starts a new run for the campaign anyway

Code

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

import os
import requests

response = requests.post(
    "https://toolsprimitives.uk/v1/tools/loop1.run.start/invoke",
    headers={"Authorization": f"Bearer {os.environ['HEELO_API_KEY']}"},
    json={"input": {
        "message": "MESSAGE",
        "channels": ["CHANNEL"],
        "page": {"slug": "SLUG", "title": "TITLE"},
    }},
    timeout=120,
)
response.raise_for_status()
print(response.json())