# Delete a policy

> **DELETE** `https://api.us.nylas.com/v3/policies/{policy_id}`

Source: https://developer.nylas.com/docs/reference/api/policies/delete-policy/

Deletes the specified policy. This action is irreversible.

**Authentication:** NYLAS_API_KEY

## Parameters

### Path parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `policy_id` | string | Yes | The ID of the policy 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/policies/<POLICY_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 deletePolicy() {
  try {
    const result = await nylas.policies.destroy({
      policyId: "<POLICY_ID>",
    });

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

deletePolicy();

```

### Python SDK

```python
from nylas import Client

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

response = nylas.policies.destroy(
    policy_id="<POLICY_ID>",
)

print(response)

```
