Hanzo

Ads

Package ads is your paid ad campaigns, launched and paused from one place.

Package ads is your paid ad campaigns, launched and paused from one place.

Base URLhttps://api.hanzo.ai
Operations7
AuthAuthorization: Bearer $HANZO_API_KEY

ads

post_v1_ads_campaigns_by_id_launch

POST /v1/ads/campaigns/{id}/launch

ParameterInTypeRequiredDescription
idpathstringyes

Returns one of the caller org's campaigns.

GET /v1/ads/campaigns/{id}

Returns one of the caller org's campaigns. An id another org owns reads as not found, so the response cannot confirm that it exists.

ParameterInTypeRequiredDescription
idpathstringyes

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

PUT /v1/ads/campaigns/{id}

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.

ParameterInTypeRequiredDescription
idpathstringyes

Request bodyapplication/json (required)

FieldTypeRequiredDescription
accountstringAccount is the provider ad-account this campaign runs on (Meta act_<id>).
budgetintegerBudget is the campaign budget in MINOR units (cents).
namestringName is the campaign's display label.
objectivestringObjective is the campaign goal as the provider names it.
platformstringPlatform is the ad network: meta, google, tiktok or x.
spendintegerSpend is the amount spent so far in MINOR units (cents).
statusstringStatus is the lifecycle state: draft, active, paused or completed.

Removes one of the caller org's campaigns and answers 204 with no body.

DELETE /v1/ads/campaigns/{id}

Removes one of the caller org's campaigns and answers 204 with no body. It deletes the stored record only: a campaign already launched keeps running on the ad network, which must be stopped there. An id another org owns reads as not found.

ParameterInTypeRequiredDescription
idpathstringyes

Returns the caller org's ad campaigns, most recently updated first, optionally narrowed to one lifecycle status.

GET /v1/ads/campaigns

Returns the caller org's ad campaigns, most recently updated first, optionally narrowed to one lifecycle status. The listing is bounded by the org: another tenant's campaigns are not reachable from here at all.

ParameterInTypeRequiredDescription
statusquerystringStatus filters to one lifecycle state (draft, active, paused, completed).
limitqueryintegerLimit caps how many campaigns come back: default 200, maximum 1000.

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

POST /v1/ads/campaigns

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/ads/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 bodyapplication/json (required)

FieldTypeRequiredDescription
accountstringAccount is the provider ad-account this campaign runs on (Meta act_<id>).
budgetintegerBudget is the campaign budget in MINOR units (cents).
namestringName is the campaign's display label.
objectivestringObjective is the campaign goal as the provider names it.
platformstringPlatform is the ad network: meta, google, tiktok or x.
spendintegerSpend is the amount spent so far in MINOR units (cents).
statusstringStatus is the lifecycle state: draft, active, paused or completed.

Rolls the caller org's ad campaigns up into four numbers: how many campaigns exist, how many are active, and the summed budget and spend across all of them.

GET /v1/ads/summary

Rolls the caller org's ad campaigns up into four numbers: how many campaigns exist, how many are active, and the summed budget and spend across all of them. Budget and spend are MINOR units (cents), the same units the campaign rows carry. It counts only this org's campaigns.


All Hanzo APIs · Interactive reference

How is this guide?

On this page