Hanzo
OpenapiCampaign

Creates a campaign as a DRAFT and returns it.

Creates a campaign as a DRAFT and returns it.

POST /v1/campaign

Addresshttps://api.hanzo.ai/v1/campaign
MethodPOST
Operationpost_campaign
AuthAuthorization: Bearer $HANZO_API_KEY

Creates a campaign as a DRAFT and returns it.

A draft is inert: nothing is sent, no connector is touched and no budget is committed until the campaign is launched. The channels named here are validated and de-duplicated by kind (one executor per kind), and every channel starts "pending" whatever the caller claims — a client can never assert a launched state.

Request

12 fields, body application/json (required).

FieldInTypeRequiredDescription
audiencebodystringAudience is the segment or audience selector this campaign targets.
budgetbodyintegerBudget is the campaign's total budget in CENTS.
channelsbodyChannelSpec[]Channels are the fan-out targets, at most one per kind (paid, organic, email) and at most 12.
channels[].accountbodystringAccount is the provider account this channel runs under: an ad-account, a page or a mailing-list id.
channels[].detailbodystringDetail is the last outcome in one secret-free line — the failure reason, or what the executor reported.
channels[].externalIdbodystringExternalID is the provider-side id of the running execution, recorded by the orchestrator at launch and handed back verbatim to read spend or to pause.
channels[].kindbodystringKind is the channel and the identity a campaign holds at most one of: paid, organic or email.
channels[].platformbodystringPlatform is the provider within the kind — meta, google, x, instagram, or the email provider.
channels[].statusbodystringStatus is this channel's own launch outcome, not the campaign's: pending (added, never launched), live, paused, failed (Detail says why) or unavailable (no…
contentbodystring[]Content is the ordered creative set.
namebodystringName is the campaign's display name.
scheduleAtbodyintegerScheduleAt is when the campaign should run, in unix seconds.

Response

StatusBodyMeaning
201campaignRecordcreated

201 body — 16 fields.

FieldInTypeAlwaysDescription
audiencebodystringAudience is an opaque reference to the segment this campaign targets.
budgetbodyintegerBudget is the campaign's total budget in CENTS, handed to each executor as the budget for its channel.
channelsbodyChannelSpec[]Channels are the fan-out targets, at most one per kind and at most 12, each carrying its own post-launch state.
channels[].accountbodystringAccount is the provider account this channel runs under: an ad-account, a page or a mailing-list id.
channels[].detailbodystringDetail is the last outcome in one secret-free line — the failure reason, or what the executor reported.
channels[].externalIdbodystringExternalID is the provider-side id of the running execution, recorded by the orchestrator at launch and handed back verbatim to read spend or to pause.
channels[].kindbodystringKind is the channel and the identity a campaign holds at most one of: paid, organic or email.
channels[].platformbodystringPlatform is the provider within the kind — meta, google, x, instagram, or the email provider.
channels[].statusbodystringStatus is this channel's own launch outcome, not the campaign's: pending (added, never launched), live, paused, failed (Detail says why) or unavailable (no…
contentbodystring[]Content is the ordered creative set, at most 32, empty entries dropped.
createdAtbodyintegerCreatedAt is when the campaign was created, in unix seconds.
idbodystringID is the campaign's server-minted handle — "cmp_" and 128 random bits — and the id every other campaign call is addressed by.
namebodystringName is the campaign's display name.
scheduleAtbodyintegerScheduleAt is when the campaign should run, in unix seconds. 0 (absent) means launch immediately.
statusbodystringStatus is the lifecycle state, server-owned and never accepted from a caller.
updatedAtbodyintegerUpdatedAt is the last write in unix seconds — an edit, a launch or a pause.

Failure carries the platform error shape — see Errors.

Examples

hanzo campaign create

Campaign API · All Hanzo APIs · Interactive reference

How is this guide?

On this page