Campaign
Package campaign is one go-to-market push across paid, organic and email at once.
Package campaign is one go-to-market push across paid, organic and email at once.
| Base URL | https://api.hanzo.ai |
| Operations | 11 |
| Auth | Authorization: Bearer $HANZO_API_KEY |
Specification
Specification pending — no HIP in hanzoai/hips declares capability: campaign yet. What this capability serves is below, from the API document; what it is — the store it owns, how it meters, what it publishes — is written as a HIP under HIP-0139.
Four surfaces
| Surface | Reaches this capability as | Coverage |
|---|---|---|
| REST | campaign at its own prefix | 11 operations |
| CLI | hanzo campaign … | 11 of 11 |
| SDK | CampaignApi in every published client | 11 methods |
| MCP | tool campaign on https://api.hanzo.ai/v1/mcp | 11 operations, 3 under the document's own id — ask describe for the rest |
Quickstart
export HANZO_API_KEY=sk-... # console.hanzo.ai → API keysThen the first call — a read that needs nothing but the key. GET /v1/campaign, operation get_campaign:
hanzo campaign listimport { Configuration, CampaignApi } from 'hanzoai';
const api = new CampaignApi(new Configuration({ accessToken: process.env.HANZO_API_KEY }));
const { data } = await api.getCampaign();from hanzoai.cloud import ApiClient, Configuration
from hanzoai.cloud.api import CampaignApi
client = ApiClient(Configuration(access_token=os.environ["HANZO_API_KEY"]))
result = CampaignApi(client).get_campaign()cfg := cloud.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := cloud.NewAPIClient(cfg)
resp, _, err := client.CampaignAPI.GetCampaign(context.Background()).Execute()
if err != nil {
return err
}use hanzo_cloud::apis::{configuration::Configuration, campaign_api};
let mut cfg = Configuration::new();
cfg.bearer_access_token = std::env::var("HANZO_API_KEY").ok();
let result = campaign_api::get_campaign(&cfg, Default::default()).await?;import ai.hanzo.cloud.ApiClient;
import ai.hanzo.cloud.api.CampaignApi;
ApiClient client = new ApiClient();
client.setRequestInterceptor(b -> b.header("Authorization", "Bearer " + System.getenv("HANZO_API_KEY")));
var result = new CampaignApi(client).getCampaign();curl https://api.hanzo.ai/v1/campaign \
-H "Authorization: Bearer $HANZO_API_KEY"Tool campaign, op get_campaign — POST the JSON-RPC envelope to https://api.hanzo.ai/v1/mcp.
curl -X POST https://api.hanzo.ai/v1/mcp \
-H "Authorization: Bearer $HANZO_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "campaign",
"arguments": {
"op": "get_campaign",
"input": {}
}
}
}'Answers 200 with object — ok.
Endpoints
| Endpoint | What it does |
|---|---|
DELETE /v1/campaign/{id}/channels/{kind} | Drops one channel from a campaign and returns the updated campaign. |
POST /v1/campaign/{id}/channels | Adds a channel to a campaign, or REPLACES the one it already has of that kind, and returns the updated campaign. |
POST /v1/campaign/{id}/launch | Launch a campaign across every channel it declares |
GET /v1/campaign/{id}/metrics | Returns a campaign's results over a window: the analytics funnel (impressions, clicks, conversions, revenue, visitors), the spend each channel's… |
POST /v1/campaign/{id}/pause | Pause every live channel on a campaign at its provider |
GET /v1/campaign/{id} | Returns one campaign of the caller's org — its name, audience, creatives, channels with their per-channel launch state, schedule, budget and status. |
PUT /v1/campaign/{id} | Rewrites a campaign's core fields — name, audience, creatives, schedule and budget — and returns the updated campaign. |
DELETE /v1/campaign/{id} | Removes one campaign of the caller's org and answers 204 with no body. |
GET /v1/campaign/summary | Returns the org's go-to-market roll-up: how many campaigns exist, how many are live, their total budget in cents, and which channel executors this… |
GET /v1/campaign | Returns the org's campaigns, newest first, optionally narrowed to one status. |
POST /v1/campaign | Creates a campaign as a DRAFT and returns it. |
How is this guide?