# Enable or disable a webhook

URL: https://docs.healthcare.dev/reference/webhooks/enable-or-disable-a-webhook

```http
PATCH https://api.healthcare.dev/v1/webhooks/{id}
```

Pro plan and up (403 `plan-upgrade-required` below Pro); never counts as a billable call. `status: disabled` stops deliveries: pending ones and events while it is off are `held`. `status: active` sends what was held and resets the failure count; it needs the plan to still include the webhook's events (403 `plan-upgrade-required`).

Requires an API key: `Authorization: Bearer hdev_live_...`. See [Authentication](/authentication).

## Path parameters

| Name | Type | Required | Description | Example |
| --- | --- | --- | --- | --- |
| `id` | string | yes | Webhook id | `5f0c2a8e-6b1d-4f7e-9a51-2c3d4e5f6a7b` |

## Request body

```json
{
  "status": "active"
}
```

## Examples

**curl**

```sh
curl -X PATCH "https://api.healthcare.dev/v1/webhooks/5f0c2a8e-6b1d-4f7e-9a51-2c3d4e5f6a7b" \
  -H "Authorization: Bearer $HDEV_API_KEY"
```

**TypeScript**

```ts
const res = await fetch("https://api.healthcare.dev/v1/webhooks/5f0c2a8e-6b1d-4f7e-9a51-2c3d4e5f6a7b", {
  method: "PATCH",
  headers: { Authorization: `Bearer ${process.env.HDEV_API_KEY}` },
});
const { data, meta } = await res.json();
```

**Python**

```python
import os
import requests

res = requests.patch("https://api.healthcare.dev/v1/webhooks/5f0c2a8e-6b1d-4f7e-9a51-2c3d4e5f6a7b", headers={"Authorization": f"Bearer {os.environ['HDEV_API_KEY']}"})
body = res.json()
```

## Response

Webhook

```json
{
  "data": {
    "id": "string",
    "url": "string",
    "description": "string",
    "events": [
      "dataset.released"
    ],
    "datasets": [
      "string"
    ],
    "subjects": [
      "string"
    ],
    "status": "active",
    "disabled_reason": "failing",
    "disabled_at": "string",
    "consecutive_failures": 1,
    "secret_hint": "string",
    "created_at": "string"
  },
  "meta": {
    "source": "cms-icd10",
    "data_version": "2026.1",
    "retrieved_at": "2026-10-24T12:00:00Z",
    "license": "Public domain (CMS). Reference data, not medical advice."
  },
  "links": {
    "self": "/v1/webhooks/5f0c2a8e-6b1d-4f7e-9a51-2c3d4e5f6a7b",
    "next": null
  }
}
```

### Fields

| Field | Type | Always present | Description |
| --- | --- | --- | --- |
| `id` | string | yes |  |
| `url` | string | yes |  |
| `description` | string \| null | yes |  |
| `events` | WebhookEventType[] | yes |  |
| `datasets` | string[] | yes |  |
| `subjects` | string[] | yes | As matched: normalized to record keys |
| `status` | "active" \| "disabled" | yes |  |
| `disabled_reason` | "failing" \| "manual" \| null | yes | `failing`: turned off after repeated failed deliveries; `manual`: by you |
| `disabled_at` | string \| null | yes |  |
| `consecutive_failures` | integer | yes | Failed attempts since the last success |
| `secret_hint` | string | yes | The secret's last characters, to tell secrets apart |
| `created_at` | string | yes |  |

## Errors

Errors are `application/problem+json` ([RFC 9457](https://www.rfc-editor.org/rfc/rfc9457)). Branch on `type`, not on `title`. See [Errors](/errors).

| Status | `type` | When |
| --- | --- | --- |
| 400 | `invalid-request` | A parameter or the body failed validation; `errors` lists each field. |
| 401 | `unauthorized` | Missing, malformed or revoked API key. |
| 403 | `plan-upgrade-required` | The plan doesn't include this feature; `required_plan` names the plan that does. |
| 404 | `not-found` | No record with that id (retired records are still returned). |
| 429 | `rate-limited / quota-exceeded` | Too many requests per second (retry after `Retry-After`), or the monthly quota is used up. |
