# Delete a webhook destination

> **DELETE** `https://api.us.nylas.com/v3/webhooks/{id}`

Source: https://developer.nylas.com/docs/reference/api/webhook-notifications/delete-webhook-by-id/

Delete a webhook destination record.

**Authentication:** NYLAS_API_KEY

## Parameters

### Path parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `id` | string | Yes |  |

## Responses

### 200 - Returns a success message.

- `data` (object)
  - `status` (string)
- `request_id` (string) - The ID for each request.

### 400 - Returns an error message.

- `error` (object)
  - `type` (string) - An alphanumeric code that represents the error type.
  - `message` (string) - A human readable message with details about the error.
- `request_id` (string) - The unique ID of the request that generated this response.

## Code samples

### cURL

```bash
curl --request DELETE \
  --url 'https://api.us.nylas.com/v3/webhooks/<WEBHOOK_ID>' \
  --header 'Accept: application/json' \
  --header 'Authorization: Bearer <NYLAS_API_KEY>' \
  --header 'Content-Type: application/json'
```

### Node.js SDK

```javascript
import Nylas from "nylas";

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

const deleteWebhook = async () => {
  try {
    await nylas.webhooks.destroy({ webhookId: "<WEBHOOK_ID>" });
    console.log("Webhook deleted successfully.");
  } catch (error) {
    console.error("Error deleting webhook:", error);
  }
};

deleteWebhook();

```

### Python SDK

```python
from nylas import Client

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

request = nylas.webhooks.destroy(
    "<WEBHOOK_ID>",
)

print(request)

```

### Ruby SDK

```ruby
require 'nylas'

nylas = Nylas::Client.new(
  api_key: "<NYLAS_API_KEY>"
)

status = nylas.webhooks.destroy(webhook_id: "<WEBHOOK_ID>")
puts status

```

### Java SDK

```java
import com.nylas.NylasClient;
import com.nylas.models.*;

public class webhooks {
    public static void main(String[] args) throws 
    NylasSdkTimeoutError, NylasApiError {

        NylasClient nylas = new NylasClient.Builder("<NYLAS_API_KEY>").build();

        WebhookDeleteResponse deleteResponse = 
        nylas.webhooks().destroy("<WEBHOOK_ID>");
        System.out.println(deleteResponse);
    }
}

```

### Kotllin SDK

```kotlin
import com.nylas.NylasClient

fun main(args: Array<String>){
    val nylas: NylasClient = NylasClient(
        apiKey = "<NYLAS_API_KEY>"
    )

    val webhooks = nylas.webhooks().destroy("<WEBHOOK_ID>")
    println(webhooks.data)
}

```
