Hanzo
OpenapiAd

Registers a new ad campaign for the caller's org and answers 201 with the…

Registers a new ad campaign for the caller's org and answers 201 with the stored row.

POST /v1/ad/campaigns

Addresshttps://api.hanzo.ai/v1/ad/campaigns
MethodPOST
Operationpost_ad_campaigns
AuthAuthorization: Bearer $HANZO_API_KEY

Registers a new ad campaign for the caller's org and answers 201 with the stored row. It only records the campaign — nothing is sent to the ad network until POST /v1/ad/campaigns/{id}/launch runs it. The org is stamped by the server from the validated principal, so a body can never place a campaign in another tenant.

Request

7 fields, body application/json (required).

FieldInTypeRequiredDescription
accountbodystringAccount is the provider ad-account this campaign runs on (Meta act_<id>).
budgetbodyintegerBudget is the campaign budget in MINOR units (cents).
namebodystringName is the campaign's display label.
objectivebodystringObjective is the campaign goal as the provider names it.
platformbodystringPlatform is the ad network: meta, google, tiktok or x.
spendbodyintegerSpend is the amount spent so far in MINOR units (cents).
statusbodystringStatus is the lifecycle state: draft, active, paused or completed.

Response

StatusBodyMeaning
201AdCampaigncreated

201 body — 11 fields.

FieldInTypeAlwaysDescription
accountbodystringAccount is the provider ad-account the campaign runs under, in Meta's act_<id> form.
budgetbodyintegerBudget is the campaign's authorized spend in MINOR units (cents). Negative clamps to 0.
createdAtbodyintegerCreatedAt is when the campaign was first stored, in unix seconds.
externalIdbodystringExternalID is the ad network's own campaign id, written by a successful launch and by nothing else — an update never touches it.
idbodystringID is the campaign's server-minted handle, "camp_" + 32 hex.
namebodystringName is the campaign's display label, and the name Meta creates the campaign object under at launch.
objectivebodystringObjective is the campaign goal spelled as the provider names it ("conversions", "OUTCOME_TRAFFIC"), passed through to the network verbatim at launch — Meta…
platformbodystringPlatform is the ad network: meta, google, tiktok or x, and nothing else — a write naming another is 400. Empty stores as meta.
spendbodyintegerSpend is spend-to-date in MINOR units (cents), as last written through create or update. Negative clamps to 0.
statusbodystringStatus is the lifecycle: draft, active, paused or completed, and nothing else — a write naming another is 400.
updatedAtbodyintegerUpdatedAt is when the row was last written, in unix seconds — set by create, update and launch.

Failure carries the platform error shape — see Errors.

Examples

hanzo ads campaigns create

Ad API · All Hanzo APIs · Interactive reference

How is this guide?

On this page