Skip to content

Docs / All tools / Loop I: Distribution

channel.expand

Adapt a piece of content for different social platforms.

0 credits. Free: preview text only. The posts are charged by the posting tools.

Example prompt

Send this to your AI app when Heelo is connected:

Post this update to Bluesky and LinkedIn

Input fields

FieldTypeDescription
contentstringThe content to distribute
channelsarray of stringTarget channels, e.g. ['bluesky','linkedin']
querystringA request in words, for a caller that has no structured input (the NL router, the ReAct loop): 'Post "We shipped" to Bluesky and LinkedIn'. The text in quotes, or after a colon, is the content; the channels named outside it are the targets. Use content and channels when you can.
messagestringYour answer to the confirmation question of an open session: 'post' to post the drafts, 'cancel' to drop them. Send it with the session_id.
budget_capnumberOptional spend ceiling in CENTS. If the pre-dispatch cost estimate exceeds it, the run is refused with error_code 'quota_exceeded' before anything posts. On a hosted environment the lower of budget_cap and the hard cap (METERED_CAP_CENTS, default 0) applies; the result's cost.cap_source says which.
estimate_onlybooleanWhen true, return the cost_hint (link vs no-link) and `previews` (the final text for each channel) without posting — used to show the user the cost and the texts before they commit. The result's cost.would_exceed_cap says whether a real run would be refused by the cap, and cost.pricing where the prices come from.
mediaobjectOptional media for a channel, by channel name: {'instagram': ['https://.../card.png']}. Only a channel whose poster takes media (Instagram, Bluesky) may be named; any other channel, or a channel that is not in `channels`, is refused before anything posts. A channel that needs media (Instagram) stops at its 'need media' prompt without it.

Output fields

The fields in data when status is success.

FieldType
resultsarray of object
answerstring

Code

The call with the input fields that the tool needs. Set HEELO_API_KEY to your API key.

import os
import requests

response = requests.post(
    "https://toolsprimitives.uk/v1/tools/channel.expand/invoke",
    headers={"Authorization": f"Bearer {os.environ['HEELO_API_KEY']}"},
    json={"input": {
        "content": "We opened early access to our API.",
        "channels": ["bluesky", "linkedin"],
    }},
    timeout=120,
)
response.raise_for_status()
print(response.json())