Delete a bonus campaign
DELETE /campaigns/{campaign_id}| Scope | program:write |
| Customer session token | Not accepted: call from your server with an API key |
| Rate limit class | write (limits) |
| Idempotency key | Required (idempotency) |
| MCP tool | charm_delete_campaign |
Deletes a draft, ended or cancelled campaign; a scheduled or running one is cancelled with PATCH instead. The deletion can be undone from the change log. Call with dry_run: true first.
Parameters
Section titled “Parameters”| Name | In | Type | Description |
|---|---|---|---|
campaign_id | path | string | The campaign’s id as GET /campaigns lists it. |
Request body
Section titled “Request body”| Field | Type | Description |
|---|---|---|
dry_run | boolean | Preview only: validate, resolve references and return the diff and summary, but write nothing. Costs no idempotency key and is limited as a read. Call with this first, show the merchant, then repeat without it. (optional) |
if_revision | integer | The program revision you last read (from GET /program or a previous write). When the program changed since, the write is refused with 409 revision_conflict instead of overwriting a concurrent admin edit. (optional) |
Response 200
Section titled “Response 200”Returns CampaignWriteResult.
| Field | Type | Description |
|---|---|---|
dry_run | boolean | True when nothing was written. |
revision | integer | The campaign’s revision after the write (unchanged on a dry run). |
operation | string: create, update, delete, none | |
diff | array of FieldChange | |
campaign | Campaign or null | (nullable) |
would_email | object or null | (nullable) |
{ "dry_run": false, "revision": 1, "operation": "create", "diff": [ { "path": "path", "before": null, "after": null } ], "campaign": { "id": "id", "name": "Gold", "type": "earning_boost", "template": "template", "status": "draft", "multiplier": 1, "stacking_mode": "stacking mode", "starts_at": "2026-10-01T09:30:00.000Z", "ends_at": "2026-10-01T09:30:00.000Z", "rule_types": [ "rule types" ], "product_scope": { "mode": "all", "product_ids": [ null ], "collection_ids": [ null ], "tags": [ null ] }, "audience": { "mode": "all", "tier_ids": [ null ], "tags": [ null ] }, "limits": { "max_orders": 1, "max_bonus_points": 120 }, "consumed": { "orders": 1, "bonus_points": 120 }, "badge_text": "badge text", "banner_copy": {}, "spotlight_rewards": [ { "reward_id": null, "sale_points_cost": null } ], "emails": { "teaser": null, "launch": null, "last_chance": null }, "deletable": false, "revision": 1, "created_at": "2026-10-01T09:30:00.000Z", "updated_at": "2026-10-01T09:30:00.000Z" }, "would_email": { "phases": [ "phases" ], "recipients": 1 }}Example
Section titled “Example”curl -X DELETE "https://charm.appfleece.app/api/v1/campaigns/<campaign_id>" \ -H "Authorization: Bearer chrm_live_..." \ -H "Idempotency-Key: $(uuidgen)" \ -H "Content-Type: application/json" \ -d '{"dry_run":false,"if_revision":1}'Errors
Section titled “Errors”unauthorized · invalid_token · insufficient_scope · access_required · not_found · validation_error · rate_limited · idempotency_conflict
Every error body carries code, message, request_id and a doc_url pointing at the matching entry in the error catalog.