# Campaign

URL: https://docs.hanzo.ai/docs/openapi/campaign

> One go-to-market push across paid, organic and email at once.

Also for this capability: **API** · [CLI](https://docs.hanzo.ai/docs/cli/campaign) · [MCP](https://docs.hanzo.ai/docs/mcp-tools/campaign) · [SDKs](https://docs.hanzo.ai/docs/sdks)

One go-to-market push across paid, organic and email at once.

> [All API references →](https://docs.hanzo.ai/docs/openapi) · [Get started →](https://docs.hanzo.ai/docs/guides)

|                |                                        |
| -------------- | -------------------------------------- |
| **Base URL**   | `https://api.hanzo.ai`                 |
| **Operations** | 11                                     |
| **Auth**       | `Authorization: Bearer $HANZO_API_KEY` |

## Specification

Specification pending — no HIP in [hanzoai/hips](https://github.com/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` | 9 operations, 2 under the document's own id — ask `describe` for the rest |

## Quickstart

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

Then the first call — a read that needs nothing but the key. `GET /v1/campaign`, operation `get_campaign`:

**CLI**

```bash
hanzo campaign list
```

**SDK**

**.ts**

```ts
import { Configuration, CampaignApi } from 'hanzoai';

const api = new CampaignApi(new Configuration({ accessToken: process.env.HANZO_API_KEY }));
const { data } = await api.getCampaign();
```

**.py**

```python
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()
```

**.go**

```go
cfg := hanzoai.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := hanzoai.NewAPIClient(cfg)

resp, _, err := client.CampaignAPI.GetCampaign(context.Background()).Execute()
if err != nil {
	return err
}
```

**.rs**

```rust
use hanzo_client::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?;
```

**.java**

```java
import ai.hanzo.cloud.ApiClient;
import ai.hanzo.cloud.api.CampaignApi;

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

var result = new CampaignApi(client).getCampaign();
```

**HTTP**

```bash
curl https://api.hanzo.ai/v1/campaign \
  -H "Authorization: Bearer $HANZO_API_KEY"
```

**MCP**

MCP reaches **campaign** through the `campaign` tool, which names its 9 operations with its own verbs — this one among them, under a name only MCP declares. `describe` explains any of them:

```bash
curl -X POST https://api.hanzo.ai/v1/mcp \
  -H "Content-Type: application/json" \
  -d '{
       "jsonrpc": "2.0",
       "id": 1,
       "method": "tools/call",
       "params": {
         "name": "describe",
         "arguments": {
           "op": "list_campaigns"
         }
       }
     }'
```

Answers `200` with `object` — ok.

## Endpoints

| Endpoint                                                                                                                         | What it does                                                                                                                                                                                                              |
| -------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [`DELETE /v1/campaign/{id}/channels/{kind}`](https://docs.hanzo.ai/docs/openapi/campaign/delete-campaign-by-id-channels-by-kind) | Drops one channel from a campaign and returns the updated campaign.                                                                                                                                                       |
| [`POST /v1/campaign/{id}/channels`](https://docs.hanzo.ai/docs/openapi/campaign/post-campaign-by-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`](https://docs.hanzo.ai/docs/openapi/campaign/post-campaign-by-id-launch)                        | Launch a campaign across every channel it declares                                                                                                                                                                        |
| [`GET /v1/campaign/{id}/metrics`](https://docs.hanzo.ai/docs/openapi/campaign/get-campaign-by-id-metrics)                        | Returns a campaign's results over a window: the analytics funnel (impressions, clicks, conversions, revenue, visitors), the spend each channel's connector reports, and the derived growth KPIs — CTR, CVR, CAC and ROAS. |
| [`POST /v1/campaign/{id}/pause`](https://docs.hanzo.ai/docs/openapi/campaign/post-campaign-by-id-pause)                          | Pause every live channel on a campaign at its provider                                                                                                                                                                    |
| [`GET /v1/campaign/{id}`](https://docs.hanzo.ai/docs/openapi/campaign/get-campaign-by-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}`](https://docs.hanzo.ai/docs/openapi/campaign/put-campaign-by-id)                                        | Rewrites a campaign's core fields — name, audience, creatives, schedule and budget — and returns the updated campaign.                                                                                                    |
| [`DELETE /v1/campaign/{id}`](https://docs.hanzo.ai/docs/openapi/campaign/delete-campaign-by-id)                                  | Removes one campaign of the caller's org and answers 204 with no body.                                                                                                                                                    |
| [`GET /v1/campaign/summary`](https://docs.hanzo.ai/docs/openapi/campaign/get-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 deployment can actually reach.                                         |
| [`GET /v1/campaign`](https://docs.hanzo.ai/docs/openapi/campaign/get-campaign)                                                   | Returns the org's campaigns, newest first, optionally narrowed to one status.                                                                                                                                             |
| [`POST /v1/campaign`](https://docs.hanzo.ai/docs/openapi/campaign/post-campaign)                                                 | Creates a campaign as a DRAFT and returns it.                                                                                                                                                                             |

---

[All Hanzo APIs](https://docs.hanzo.ai/docs/openapi) · [Interactive reference](https://docs.hanzo.ai/docs/openapi/reference)
