Skip to content

Delete a bonus campaign

DELETE /campaigns/{campaign_id}
Scopeprogram:write
Customer session tokenNot accepted: call from your server with an API key
Rate limit classwrite (limits)
Idempotency keyRequired (idempotency)
MCP toolcharm_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.

NameInTypeDescription
campaign_idpathstringThe campaign’s id as GET /campaigns lists it.
FieldTypeDescription
dry_runbooleanPreview 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_revisionintegerThe 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)

Returns CampaignWriteResult.

FieldTypeDescription
dry_runbooleanTrue when nothing was written.
revisionintegerThe campaign’s revision after the write (unchanged on a dry run).
operationstring: create, update, delete, none
diffarray of FieldChange
campaignCampaign or null(nullable)
would_emailobject 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
}
}
Terminal window
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}'

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.