# Change a webhook endpoint

PATCH /v1/webhooks/{id}: Change a webhook endpoint

```http
PATCH /v1/webhooks/{id}
```

|  |  |
|---|---|
| Operation id | `updateWebhook` |
| Key scope | `admin`: admin keys only |
| Section | [Webhooks](https://docs.kaab.ist/reference/api#webhooks) |

## Parameters

| Name | In | Type | Required | Description |
|---|---|---|---|---|
| `id` | path | string | yes | pattern `^whk_[0-9a-hjkmnp-tv-z]{26}$` |

## Request body

| Field | Type | Required | Description |
|---|---|---|---|
| `url` | string (uri) |  |  |
| `events` | string[] |  | min items 1 · max items 50 |
| `description` | string or null |  | max length 1000 |
| `mode` | `"live"`, `"test"`, `"both"` |  |  |
| `format` | `"standard"`, `"discord"`, `"slack"` |  |  |
| `status` | `"active"`, `"disabled"` |  |  |

## Example request

```bash
curl -X PATCH "https://api.kaab.ist/v1/webhooks/{id}" \
  -H "Authorization: Bearer $KAAB_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"status":"disabled"}'
```

## Responses

### 200

Webhook

[Webhook](https://docs.kaab.ist/reference/api/schemas/webhook)

```json
{
  "id": "whk_01j9zqk3q7m4n5p6r7s8t9v0wx",
  "object": "webhook",
  "url": "https://hooks.acme.test/kaab",
  "events": [
    "job.*",
    "credits.low"
  ],
  "mode": "both",
  "format": "standard",
  "status": "active",
  "description": null,
  "disabled_reason": null,
  "previous_secret_expires_at": null,
  "created_at": "2026-09-18T10:00:00Z"
}
```

## Errors

Every error answers with the [error envelope](https://docs.kaab.ist/reference/api/schemas/error-response); its `code` is one of the [error codes](https://docs.kaab.ist/reference/codes#errors).

| Status | When |
|---|---|
| 400 | `request_invalid`: request validation failed |
| 401 | Missing or invalid API key |
| 402 | `insufficient_credits`: top up to continue |
| 403 | The key's scope does not cover this operation |
| 404 | Resource not found |
| 409 | Conflicting state (see `error.code`) |
| 422 | Semantically invalid request (see `error.code`) |
| 429 | Rate limited; see `Retry-After` |
| 500 | `internal`: unexpected server error |
