# Remove leads (/api-reference/leads/removeLeads)

## Remove leads

`DELETE https://app.alienmail.io/api/v1/campaigns/{id}/leads`

Removes up to 500 leads from a campaign by email. Their waiting emails are cancelled. The emails the campaign already sent them stay in its statistics, and the people stay in your workspace's leads.

Emails that are not leads of the campaign are counted in `notInCampaign`, so the call is safe to repeat. An `archived` campaign returns 409.

Requires the `LEAD_CAMPAIGN_ENROLL` permission.

Authentication: `Authorization: Bearer <your API key>`

### Parameters

| Name | In | Type | Required | Description |
|---|---|---|---|---|
| `id` | path | integer | yes | The campaign id: the number in the campaign URL in Alienmail, or `id` from the campaign list. An id that is not a campaign of your workspace returns 404. |

### Request body

| Field | Type | Required | Description |
|---|---|---|---|
| `emails` | string[] | yes | 1 to 500 email addresses to remove from the campaign. |

Example:

```json
{
  "emails": [
    "ada@example.com",
    "grace@example.com"
  ]
}
```

### Responses

**200**: What happened to the emails in the request.

```json
{
  "received": 2,
  "removed": 1,
  "notInCampaign": 1,
  "invalid": []
}
```

**400**: The request is invalid: `fields` names the fields to fix. Code `invalid_json` when the body is not valid JSON.

**401**: The API key is missing, wrong or revoked, its creator left the workspace or was suspended, or the workspace is archived or deleted.

**403**: The API key's role lacks the permission this endpoint needs.

**404**: The campaign, lead or mailbox was not found in your workspace.

**409**: The campaign, lead or mailbox is in a state that does not allow this. `message` says why.

**415**: The body is not JSON: send it with `Content-Type: application/json`.

**429**: More than 120 requests in a minute with this key, or a workspace limit on adding and removing leads.

Errors look like `{ "error": { "code": "not_found", "message": "Campaign not found" } }`. See the Errors page.