---
title: "Delete Campaign"
method: DELETE
path: "/api/campaigns/{campaign_id}"
tags: ["Campaigns"]
---

# Delete Campaign

`DELETE /api/campaigns/{campaign_id}`

## Request

- Base URL: `https://api.kolens.ai` (the document declares no server; this is the origin it was published from)
- URL: `https://api.kolens.ai/api/campaigns/{campaign_id}`
- Auth: HTTP bearer

Delete a campaign and its placements.

Attached videos survive. Tracking a video and having paid for it are
different facts, and losing the tracking because the bookkeeping was
tidied would be genuine data loss.

The detach is done here rather than left to the column's
``ON DELETE SET NULL``. That clause describes the model, but
``placement_id`` reaches the deployed table through
``ALTER TABLE ... ADD COLUMN`` in ``run_alter_migrations``, which
adds no constraint — so in production there is no foreign key to
act on and the videos would be left pointing at placements that no
longer exist. Doing it explicitly is the only version that is true
on both the model and the live database.

## Path parameters

- `campaign_id` string, required

## Headers

- `x-kolens-user-id` string, nullable
- `x-kolens-workspace-id` string, nullable

## Response `204`

Successful Response

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/kolens/apis/kolens-api.md) · [All operations](https://skmtc.dev/kolens/apis/kolens-api/llms.txt) · [OpenAPI document](https://skmtc.dev/kolens/apis/kolens-api/revisions/5d6865ab0a24?raw)
