Publish
The publish tool is a consolidated tool that allows the agent to perform multiple publishing actions in a single tool call. It can:
- Create or Update Content: Save content to the database with a
publishedstatus, including metadata like assets and URLs. - Publish to Social Media: Publish the content to specified social media accounts via Outstand.
- Send to Audience: Send the content as a bulk message to an audience via WhatsApp or Email.
Usage
You must provide at least one valid source of content: text, assets (media IDs), or urls.
You must also provide parameters for at least one action:
- To save content, provide
titleandtype(for new content) orcontent_id(to update). - To publish to social media, provide the
social_accountsarray. - To send to an audience, provide
audience_idandchannel.
Parameters
text(string, optional): Main text content.assets(array of strings, optional): Array of media asset IDs.urls(array of strings, optional): Array of URLs to include.
Content DB Parameters
content_id(string, optional): ID of existing content to update.title(string, required for create): Title of the content.type(string, required for create): Type of content (e.g.,social_post,blog_post).
Social Media Parameters
social_accounts(array of strings, optional): Social account identifiers to publish to (e.g.,["linkedin", "twitter"]).scheduledAt(string, optional): ISO 8601 date to schedule the social post.
Audience Parameters
audience_id(string, optional): Audience UUID to send to.channel(string, optional): Channel for audience send ("whatsapp"or"email").subject(string, required if channel is email): Subject for email audience send.from(string, optional): Sender display name for audience.audience_email_mode(string, optional): For email only —mail(default, queue via conversations) ornewsletter(immediate send with tracking, no HTML signature).placeholders_when_unresolved(string, optional): When creating/updating content in the same call:strip_tokensorskip_recipient, stored incontent.metadata.placeholders.when_unresolvedfor merge-field policy on the audience send.
Merge fields
Use {{lead.*}} and {{site.name}} in text / email subject as documented on sendBulkMessages. When content is saved in the same publish call, its id is passed to the bulk sender so placeholder policy applies.
For WhatsApp audience sends, a single Twilio Content Template is created (or reused) for the whole campaign; merge tokens become numeric placeholders and each lead is queued with its own ContentVariables. The same {{lead.*}} / {{site.name}} tokens that work for newsletter work here — you do not need one template per recipient.
Returns
The tool returns an object with a success boolean and details for each attempted action:
{
"success": true,
"actions_attempted": ["content", "social", "audience"],
"content": {
"success": true,
"id": "content-uuid"
},
"social": {
"success": true,
"result": { ... }
},
"audience": {
"success": true,
"total_sent": 100,
"total_failed": 0,
...
}
}If an action fails, its specific object will have success: false and an error message, and the overall success flag may be set to false indicating a partial or complete failure.