# Delete a list

> **DELETE** `https://api.us.nylas.com/v3/lists/{list_id}`

Source: https://developer.nylas.com/docs/reference/api/lists/delete-list/

Deletes the specified list. This action is irreversible and cascades to all items in the list. Rules that
reference the list through an `in_list` condition no longer match its values after deletion.

**Authentication:** NYLAS_API_KEY

## Parameters

### Path parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `list_id` | string | Yes | The ID of the list to access. |

## Responses

### 200 - OK

- `request_id` (string) - ID of the request.

### 400 - Bad Request

- `request_id` (string) - The request ID.
- `error` (object) - The response error object.
  - `type` (string) - The error type.
  - `message` (string) - The error message.
  - `provider_error` (object) - The error from the provider.

### 401 - Unauthorized

- `request_id` (string) - The request ID.
- `error` (object) - The response error object.
  - `type` (string) - The error type.
  - `message` (string) - The error message.
  - `provider_error` (object) - The error from the provider.

### 404 - Not Found

- `request_id` (string) - The request ID.
- `error` (object) - The response error object.
  - `type` (string) - The error type.
  - `message` (string) - The error message.
  - `provider_error` (object) - The raw error from the provider, if available
    - `code` (string)
    - `message` (string)

### 429 - Rate Limit

- `request_id` (string) - The request ID.
- `error` (object) - The response error object.
  - `type` (string) - The error type.
  - `message` (string) - The error message.

## Code samples

### cURL

```bash
curl -X DELETE "https://api.us.nylas.com/v3/lists/<LIST_ID>" \
  -H "Authorization: Bearer <NYLAS_API_KEY>"

```

### Node.js SDK

```javascript
import Nylas from "nylas";

const nylas = new Nylas({
  apiKey: "<NYLAS_API_KEY>",
  apiUri: "<NYLAS_API_URI>",
});

async function deleteList() {
  try {
    const result = await nylas.lists.destroy({
      listId: "<LIST_ID>",
    });

    console.log("Deleted list:", result);
  } catch (error) {
    console.error("Error deleting list:", error);
  }
}

deleteList();

```

### Python SDK

```python
from nylas import Client

nylas = Client(
    "<NYLAS_API_KEY>",
    "<NYLAS_API_URI>",
)

response = nylas.lists.destroy(
    list_id="<LIST_ID>",
)

print(response)

```
