# Launch campaign

URL: https://docs.hanzo.ai/docs/openapi/campaign/post-campaign-by-id-launch

> Pushes the campaign live on each of its channels through that channel's executor and answers the whole campaign with the per-channel outcome written back onto it.

`POST /v1/campaign/{id}/launch`

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

|               |                                                |
| ------------- | ---------------------------------------------- |
| **Address**   | `https://api.hanzo.ai/v1/campaign/{id}/launch` |
| **Method**    | `POST`                                         |
| **Operation** | `post_campaign_by_id_launch`                   |
| **Auth**      | `Authorization: Bearer $HANZO_API_KEY`         |

Pushes the campaign live on each of its channels through that channel's executor and answers the whole campaign with the per-channel outcome written back onto it.

The fan-out is BEST-EFFORT PER CHANNEL, and the honest reading of the result is the rule most callers get wrong: one channel failing never aborts the others, so each channel row carries its own `live`, `failed` or `unavailable` status and detail, and a paid launch can be live while an email launch failed. The campaign itself is `live` when AT LEAST ONE channel launched and `failed` only when none did — `live` is not a claim that every channel launched. Repeating the call is safe: a channel already live is skipped, never re-launched. A campaign carrying more than one creative has its variant assigned here by the experiment client and tagged as `utm_content`.

Org-scoped and fails closed: a valid bearer is required (401 without one), the campaign is read under the caller's OWN org so another tenant's id is a 404, and a campaign with no channels is a 400 — there is nothing to launch. Each executor resolves its own org's connector token from the org passed to it, so a launch can never spend through another tenant's connector.

## Request

1 field.

| Field | In   | Type   | Required | Description |
| ----- | ---- | ------ | -------- | ----------- |
| `id`  | path | string | yes      |             |

## Response

The document declares no response body for this operation. It answers `200` on success and the platform error shape on failure — see [Errors](https://docs.hanzo.ai/docs/errors).

## Examples

**CLI**

```bash
hanzo campaign launch <id>
```

**SDK**

**.ts**

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

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

**.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).post_campaign_by_id_launch(id='id')
```

**.go**

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

resp, _, err := client.CampaignAPI.PostCampaignByIdLaunch(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::post_campaign_by_id_launch(&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).postCampaignByIdLaunch();
```

**HTTP**

```bash
curl -X POST https://api.hanzo.ai/v1/campaign/<id>/launch \
  -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"
         }
       }
     }'
```

---

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