Publish distributes one CMS content item to the channels recorded on it and…
Publish distributes one CMS content item to the channels recorded on it and returns the honest per-channel outcome.
POST /v1/content/publish
| Address | https://api.hanzo.ai/v1/content/publish |
| Method | POST |
| Operation | post_content_publish |
| Auth | Authorization: Bearer $HANZO_API_KEY |
Publish distributes one CMS content item to the channels recorded on it and returns the honest per-channel outcome. The item names itself — its caption, media and channel list are read from the stored document, not from this request. It is idempotent per channel (a channel already posted for this item is skipped), and a publish that loses the per-item lease to a live publisher answers status "in_progress" having posted nothing.
Request
3 fields, body application/json (required).
| Field | In | Type | Required | Description |
|---|---|---|---|---|
doctype | body | string | — | DocType is the content type holding the item: Campaign, SocialPost or Asset. |
name | body | string | — | Name is the document within that type — the item to distribute. |
scheduleAt | body | string | — | ScheduleAt hands a future go-live to the channel's own scheduler, as an ISO-8601 time. |
Response
| Status | Body | Meaning |
|---|---|---|
200 | PublishResult | ok |
200 body — 10 fields.
| Field | In | Type | Always | Description |
|---|---|---|---|---|
channels | body | string[] | — | Channels is the channel list read off the content document — integration ids or provider names, as the item declares them. |
externalIds | body | object | — | ExternalIDs maps channel id → the post id that channel returned, merged with everything earlier publishes recorded. |
externalIds.* | body | string | — | |
results | body | ChannelResult[] | — | Results is the outcome per channel — which went out, which did not and why — covering the whole fan-out including failures, so partial success is never… |
results[].channel | body | string | — | the social integration id targeted |
results[].error | body | string | — | short reason, when it failed |
results[].externalId | body | string | — | social post id, when it went out |
results[].provider | body | string | — | "x" | "instagram" | ... |
results[].status | body | string | — | "distributed" | "scheduled" | "failed" |
status | body | string | — | Status is the ONE headline, drawn from: "distributed" (something is on record and went out now), "scheduled" (same, handed to the channel's own scheduler for… |
Failure carries the platform error shape — see Errors.
Examples
hanzo content publishimport { Configuration, ContentApi } from 'hanzoai';
const api = new ContentApi(new Configuration({ accessToken: process.env.HANZO_API_KEY }));
const { data } = await api.postContentPublish({ doctype: "<doctype>", name: "<name>" });from hanzoai.cloud import ApiClient, Configuration
from hanzoai.cloud.api import ContentApi
client = ApiClient(Configuration(access_token=os.environ["HANZO_API_KEY"]))
result = ContentApi(client).post_content_publish(doctype="<doctype>", name="<name>")cfg := cloud.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := cloud.NewAPIClient(cfg)
resp, _, err := client.ContentAPI.PostContentPublish(context.Background()).Execute()
if err != nil {
return err
}use hanzo_cloud::apis::{configuration::Configuration, content_api};
let mut cfg = Configuration::new();
cfg.bearer_access_token = std::env::var("HANZO_API_KEY").ok();
let result = content_api::post_content_publish(&cfg, Default::default()).await?;import ai.hanzo.cloud.ApiClient;
import ai.hanzo.cloud.api.ContentApi;
ApiClient client = new ApiClient();
client.setRequestInterceptor(b -> b.header("Authorization", "Bearer " + System.getenv("HANZO_API_KEY")));
var result = new ContentApi(client).postContentPublish();curl -X POST https://api.hanzo.ai/v1/content/publish \
-H "Authorization: Bearer $HANZO_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"doctype": "<doctype>",
"name": "<name>"
}'The door reaches content through the content tool, which names its 6 operations with its own verbs — this one among them, under a name only the door declares. describe explains any of them:
curl -X POST https://api.hanzo.ai/v1/mcp \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "describe",
"arguments": {
"op": "get_content_board"
}
}
}'How is this guide?