Ad

Your paid ad campaigns, launched and paused from one place.

Also for this capability: API · CLI · MCP · SDKs

Your paid ad campaigns, launched and paused from one place.

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

Specification

Specification pending — no HIP in hanzoai/hips declares capability: ad 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

SurfaceReaches this capability asCoverage
RESTad at its own prefix7 operations
CLIhanzo ad …7 of 7
SDKAdApi in every published client7 methods
MCPtool ad on https://api.hanzo.ai/v1/mcp6 operations, 1 under the document's own id — ask describe for the rest

Quickstart

export HANZO_API_KEY=sk-...   # console.hanzo.ai → API keys

Then the first call — a read that needs nothing but the key. GET /v1/ad/summary, operation get_ad_summary:

hanzo ad summary
import { Configuration, AdApi } from 'hanzoai';

const api = new AdApi(new Configuration({ accessToken: process.env.HANZO_API_KEY }));
const { data } = await api.getAdSummary();
from hanzoai.cloud import ApiClient, Configuration
from hanzoai.cloud.api import AdApi

client = ApiClient(Configuration(access_token=os.environ["HANZO_API_KEY"]))
result = AdApi(client).get_ad_summary()
cfg := hanzoai.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := hanzoai.NewAPIClient(cfg)

resp, _, err := client.AdAPI.GetAdSummary(context.Background()).Execute()
if err != nil {
	return err
}
use hanzo_client::apis::{configuration::Configuration, ad_api};

let mut cfg = Configuration::new();
cfg.bearer_access_token = std::env::var("HANZO_API_KEY").ok();

let result = ad_api::get_ad_summary(&cfg, Default::default()).await?;
import ai.hanzo.cloud.ApiClient;
import ai.hanzo.cloud.api.AdApi;

ApiClient client = new ApiClient();
client.setBearerToken(System.getenv("HANZO_API_KEY"));

var result = new AdApi(client).getAdSummary();
curl https://api.hanzo.ai/v1/ad/summary \
  -H "Authorization: Bearer $HANZO_API_KEY"

Tool ad, op get_ad_summary — 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": "ad",
         "arguments": {
           "op": "get_ad_summary",
           "input": {}
         }
       }
     }'

Answers 200 with object — ok.

Endpoints

EndpointWhat it does
POST /v1/ad/campaigns/{id}/launchRun one of your stored campaigns on its ad network
GET /v1/ad/campaigns/{id}Returns one of the caller org's campaigns.
PUT /v1/ad/campaigns/{id}Replaces the user-owned fields of one of the caller org's campaigns and answers the stored row.
DELETE /v1/ad/campaigns/{id}Removes one of the caller org's campaigns and answers 204 with no body.
GET /v1/ad/campaignsReturns the caller org's ad campaigns, most recently updated first, optionally narrowed to one lifecycle status.
POST /v1/ad/campaignsRegisters a new ad campaign for the caller's org and answers 201 with the stored row.
GET /v1/ad/summaryRolls 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.

All Hanzo APIs · Interactive reference

Was this page useful?