# Delete an AI label rule

Source: https://docs.maylee.app/api-reference/ai-label-rules/delete-ai-label-rule

`DELETE https://api.maylee.app/api/v1/ai-label-rules/{ruleId}`

Scope: `write`.

Deletes the rule and its label, and removes the label from every email that carried it.

## Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `ruleId` | path | string | yes |  |

## Example request

```bash
curl -X DELETE "https://api.maylee.app/api/v1/ai-label-rules/<ruleId>" \
  -H "Authorization: Bearer $MAYLEE_KEY"
```

## Responses

### 204

Deleted.

### 401

Missing, malformed, revoked or expired API key.

### 403

Key lacks the required scope, or outbound sending is not enabled on it.

### 404

Not found, or belongs to another workspace.

### 429

Per-minute rate limit (`RATE_LIMIT_EXCEEDED`) or monthly quota (`QUOTA_EXCEEDED`) exhausted.

Errors use the format `{ "code", "error", "details" }`: see [Errors](/errors.md).
