# **Authentication**

- Include your `Access-Token` in the header of your requests.

- Include your `x-api-key` The API key provided by GenLogs. This header must be included in the request.

# **Permissions**

The `external-api-delete-alert-webhook-endpoint` permission is required to access this endpoint.

# **Endpoint**

- **URL:** `https://api.genlogs.io/alerts/webhook/{webhook_id}`

- **Method:** `DELETE`

# **Headers**

- **Access-Token**: (string, required): Access token obtained from the "Create Access Token" endpoint.

- **X-Api-Key** (string, required): The API key provided by GenLogs.

# **Path Params**

- **webhook_id** (string, UUID format, required): Existent webhook ID, to be deleted.

# **Request Example:**

```bash
curl --location --request DELETE 'https://api.genlogs.io/alerts/webhook/{webhook_id}' \
--header 'access-token: <your-api-access-token>' \
--header 'x-api-key: <your-x-api-key>' 
```

# **Response:**

- **200 OK:** A JSON object containing the information of the deleted alert webhook.

- **400 Bad Request:** If webhook id is malformed or missing.

- **401 Unauthorized:** If the authentication credentials (Access-Token) is missing or incorrect.

- **403 Forbidden**: If the permission has not been added to your user.

- **404 Not Found**: If the provided `webhook_id` doesn't exist or not belongs to the customer.

- **500 Internal Server Error:** If there is an issue on the server that prevents processing the request.

# **Response Body:**

**200 OK – Webhook Deleted Successfully**

```json
{
    "id": "0a7f4670-aeed-491a-91ae-af7e88b397b3",
    "webhook_url": "https://example.domain/webhooks/genlogs-alerts",
    "description": "test-to-be-deleted",
    "created_at": "2026-02-20T18:58:19.132530",
    "deleted": true
}
```

**400 Bad Request**

Returned when:

- The provided webhook id is malformed or missing

```json
{
    "message": "Invalid webhook ID format.",
    "error_code": "VALIDATION_ERROR"
}
```

**401 Unauthorized**

- When access-token is missing or expired

```json
{
    "detail": "Token is missing!"
}
```

```json
{
    "detail": "Token is expired!"
}
```

**403 Forbidden**

```json
{
    "detail": "User not allowed to access this endpoint"
}
```

**404 Not Found**

- When the webhook is not found or does not belong to customer

```json
{
    "message": "Webhook 0a7f4670-aeed-491a-91ae-af7e88b397b3 not found or does not belong to customer",
    "error_type": "WebhookNotFoundError",
    "error_code": "WEBHOOK_NOT_FOUND"
}
```

# **Delete alert webhook**

`delete/alerts/webhook/{webhook_id}`

Delete an alert webhook by ID. Requires ownership for the authenticated customer. Returns the deleted webhook data (id, webhook_url, description, created_at). Requires admin or external-api-delete-alert-webhook-endpoint.

## Path parameters

**webhook_id** string · uuid Required

UUID of the webhook to delete

## Header parameters

**Access-Token** string Required

JWT access token for authentication

**X-Api-Key** string Required

API key for authentication

## Responses

- **200**: Webhook deleted successfully; returns deleted webhook data

- **400**: Bad Request – invalid webhook ID format

- **401**: Unauthorized – missing or invalid token

- **403**: Forbidden – insufficient permissions

- **404**: Not Found – webhook does not exist or does not belong to customer

- **500**: Internal Server Error

```bash
DELETE /alerts/webhook/{webhook_id} HTTP/1.1
Access-Token: text
X-Api-Key: text
Accept: */*
```

**200**: Webhook deleted successfully; returns deleted webhook data

```json
{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "webhook_url": "https://example.com/webhook",
  "description": "Sample webhook",
  "created_at": "2024-01-15T10:30:00Z",
  "deleted": true
}
```
