Replace calendar

Replaces a post's editable fields.

PUT /v1/marketing/calendar/{id}

Addresshttps://api.hanzo.ai/v1/marketing/calendar/{id}
MethodPUT
Operationput_marketing_calendar_by_id
AuthAuthorization: Bearer $HANZO_API_KEY

Replaces a post's editable fields. It is a full write, not a patch, and it RESETS the lifecycle from the schedule: a scheduledAt makes the post "scheduled" again and none makes it a draft — so editing a failed post requeues it rather than leaving it stuck.

Request

11 fields, body application/json (required).

FieldInTypeRequiredDescription
idpathstringyesID is the server-assigned post id ("cal_" + 128 random bits).
bodybodystring—Body is the post text.
channelbodystring—Channel is the target network: x, facebook, instagram, linkedin, tiktok, youtube or threads.
createdAtbodyinteger (int64)—CreatedAt is unix seconds when the post was added, server-assigned and never rewritten.
errorbodystring—Error is the exact reason the last publish attempt failed — the honest record behind a "failed" status, never a faked success.
idbodystring—ID is the server-assigned post id ("cal_" + 128 random bits).
publishedAtbodyinteger (int64)—PublishedAt is when the publish succeeded; 0 until it does.
scheduledAtbodyinteger (int64)—ScheduledAt is the unix publish time; 0 leaves the post a draft, and any value makes it "scheduled" for the durable sweep to pick up.
statusbodystring—Status is draft, scheduled, published, failed or canceled.
titlebodystring—Title is the post's internal label, capped at 1024 bytes.
updatedAtbodyinteger (int64)—UpdatedAt is unix seconds of the last write, server-assigned.

Response

StatusBodyMeaning
200marketing.CalendarPostok
defaultproblem-detailsrefused

200 body — 10 fields.

FieldInTypeAlwaysDescription
bodybodystring—Body is the post text.
channelbodystring—Channel is the target network: x, facebook, instagram, linkedin, tiktok, youtube or threads.
createdAtbodyinteger (int64)—CreatedAt is unix seconds when the post was added, server-assigned and never rewritten.
errorbodystring—Error is the exact reason the last publish attempt failed — the honest record behind a "failed" status, never a faked success.
idbodystring—ID is the server-assigned post id ("cal_" + 128 random bits).
publishedAtbodyinteger (int64)—PublishedAt is when the publish succeeded; 0 until it does.
scheduledAtbodyinteger (int64)—ScheduledAt is the unix publish time; 0 leaves the post a draft, and any value makes it "scheduled" for the durable sweep to pick up.
statusbodystring—Status is draft, scheduled, published, failed or canceled.
titlebodystring—Title is the post's internal label, capped at 1024 bytes.
updatedAtbodyinteger (int64)—UpdatedAt is unix seconds of the last write, server-assigned.

Failure carries the platform error shape — see Errors.

Examples

hanzo marketing calendar set <id>
import { Configuration, MarketingApi } from 'hanzoai';

const api = new MarketingApi(new Configuration({ accessToken: process.env.HANZO_API_KEY }));
const { data } = await api.putMarketingCalendarById({ id: 'id', body: "<body>", channel: "<channel>" });
from hanzoai.cloud import ApiClient, Configuration
from hanzoai.cloud.api import MarketingApi

client = ApiClient(Configuration(access_token=os.environ["HANZO_API_KEY"]))
result = MarketingApi(client).put_marketing_calendar_by_id(id='id', body="<body>", channel="<channel>")
cfg := hanzoai.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := hanzoai.NewAPIClient(cfg)

resp, _, err := client.MarketingAPI.PutMarketingCalendarById(context.Background()).Execute()
if err != nil {
	return err
}
use hanzo_client::apis::{configuration::Configuration, marketing_api};

let mut cfg = Configuration::new();
cfg.bearer_access_token = std::env::var("HANZO_API_KEY").ok();

let result = marketing_api::put_marketing_calendar_by_id(&cfg, Default::default()).await?;
import ai.hanzo.cloud.ApiClient;
import ai.hanzo.cloud.api.MarketingApi;

ApiClient client = new ApiClient();
client.setBearerToken(System.getenv("HANZO_API_KEY"));

var result = new MarketingApi(client).putMarketingCalendarById();
curl -X PUT https://api.hanzo.ai/v1/marketing/calendar/<id> \
  -H "Authorization: Bearer $HANZO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
       "body": "<body>",
       "channel": "<channel>"
     }'

MCP reaches marketing through the marketing tool, which names its 35 operations with its own verbs — this one among them, under a name only MCP 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": "list_marketing_audiences"
         }
       }
     }'

Marketing API · All Hanzo APIs · Interactive reference

Was this page useful?