# Delete campaign

> Delete a stopped or completed campaign, or a draft that never went live.

Source: https://docs.mycrmsim.com/docs/dbr-campaigns/delete-dbr-campaign

```http
DELETE https://backend.mysmsgateway.app/api/v1/ext/dbr-campaigns/{id}
```

- Category: myCRMSIM DBR Campaigns / DBR Campaigns
- Auth: Bearer access token
- Scope: `dbr_campaigns.write`

A live or running campaign must be stopped first; the campaign service refuses otherwise, and its status, `code` and `message` are passed on. The agent is kept.

## Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | path | string | yes | Campaign id. Example: `c7d2e9f0-1a2b-4c3d-8e4f-5a6b7c8d9e0f` |
| `workspace_id` | query | number | yes | A workspace of the installer. Example: `7` |

## Response 200

OK

```json
{
  "success": true,
  "message": "Campaign deleted.",
  "data": {
    "deleted": true
  }
}
```

## Response 409

Still running (stop it first)

```json
{
  "success": false,
  "message": "Stop the campaign before deleting it."
}
```

## Response 401

Missing or invalid token

```json
{
  "success": false,
  "message": "Invalid or expired access token."
}
```

## Response 403

Missing scope

```json
{
  "success": false,
  "message": "Missing scope(s): dbr_campaigns.write. This integration was granted: …"
}
```

## Response 404

workspace_id does not exist or is not the installer's (same response for both)

```json
{
  "success": false,
  "message": "Workspace not found or not accessible to this token"
}
```

## Response 404

The campaign does not exist or is in another workspace

```json
{
  "success": false,
  "message": "Campaign not found or not accessible to this token"
}
```
