`lumail@2.1.0` · [`lumail.campaigns`](/docs/sdk/v2/campaigns)

```typescript
campaigns.delete(campaignId: string): Promise<LumailResult<DeleteCampaignResponse>>
```

Deletes the campaign.

## Path Parameters

| Name | Type | Description |
| ------------ | ------ | -------------------------- |
| `campaignId` | string | **Required.** Campaign id. |

## Response Fields

| Field | Type | Description |
| --------- | ------ | --------------------------- |
| `object` | string | Resource name (`campaign`). |
| `id` | string | Deleted campaign id. |
| `deleted` | `true` | Always `true` on success. |

`data` is `{ object, id, deleted: true }`. Failures return `{ data: null, error: { name, message, statusCode } }`.


## API Reference
**Method:** DELETE
**Endpoint:** /api/v2/campaigns/:campaignId

### SDK
```ts
import { Lumail } from "lumail";

const lumail = new Lumail({ apiKey: process.env.LUMAIL_API_KEY });
const { data, error } = await lumail.campaigns.delete("cmp_abc123");
if (error) {
  throw error;
}
console.log(data.deleted, data.id);
```

### cURL
```bash
curl -X DELETE https://lumail.io/api/v2/campaigns/cmp_abc123 \
  -H "Authorization: Bearer YOUR_API_TOKEN"
```

### JavaScript
```javascript
const response = await fetch("https://lumail.io/api/v2/campaigns/cmp_abc123", {
  method: "DELETE",
  headers: {
    Authorization: "Bearer YOUR_API_TOKEN",
  },
});
const data = await response.json();
```

### Success Response
```json
{
  "object": "campaign",
  "id": "cmp_abc123",
  "deleted": true
}
```

### Error Response
```json
{
  "name": "not_found",
  "message": "Campaign not found",
  "statusCode": 404
}
```
