Hanzo
OpenapiAd

Replaces the user-owned fields of one of the caller org's campaigns and answers…

Replaces the user-owned fields of one of the caller org's campaigns and answers the stored row.

PUT /v1/ad/campaigns/{id}

Addresshttps://api.hanzo.ai/v1/ad/campaigns/{id}
MethodPUT
Operationput_ad_campaigns_by_id
AuthAuthorization: Bearer $HANZO_API_KEY

Replaces the user-owned fields of one of the caller org's campaigns and answers the stored row. It is a full replace, not a patch: every field is written from the request, so an omitted one is cleared. externalId is launch-owned and is never touched here, so editing a campaign cannot break its link to a live provider execution.

Request

8 fields, body application/json (required).

FieldInTypeRequiredDescription
idpathstringyes
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
200AdCampaignok

200 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 set <id>

Ad API · All Hanzo APIs · Interactive reference

How is this guide?

On this page