# webhooks.update

`PATCH /api/public/v1/webhooks/{id}`

Change URL, description or events, or enable/disable (disabling fails pending deliveries); optional expected revision.

- Capability: `webhook.manage`
- Command: yes — send a `command_id`; resending the same id and body returns the stored receipt
- MCP tool: `webhooks_update`

## Parameters

| Name | In | Type | Required | Description |
|---|---|---|---|---|
| `id` | path | string (uuid) | yes | Webhook id |
| `command_id` | body | string (uuid) | yes | Client-generated UUID for this command. Send the same id (and body) again to get the stored receipt instead of a second change; a different body under the same id is CONFLICT. |
| `expected_revision` | body | integer | no | The revision you last read; a newer revision on the server is CONFLICT (min 1, max 9007199254740991) |
| `url` | body | string | no | (min length 12, max length 2048) |
| `description` | body | string | no | (max length 200) |
| `events` | body | array<"session.ready" \| "session.failed" \| "session.closed" \| "worker.offline" \| "worker.online" \| "run.completed" \| "feedback.updated"> | no | (min 1 items, max 16 items) |
| `enabled` | body | boolean | no |  |

## Response

`201` with `{ data, replayed: false, correlation_id }` the first time; `200` with `replayed: true` for a repeated `command_id`.

The field list of this reply is not published yet; read `data` as JSON.

## Errors

| Code | HTTP | Retryable |
|---|---|---|
| `UNAUTHENTICATED` | 401 | no |
| `FORBIDDEN` | 403 | no |
| `RATE_LIMITED` | 429 | yes |
| `VALIDATION_FAILED` | 422 | no |
| `NOT_FOUND` | 404 | no |
| `CONFLICT` | 409 | no |
| `OUTCOME_UNKNOWN` | 202 | yes |
| `DEPENDENCY_UNAVAILABLE` | 503 | yes |
| `UNKNOWN` | 500 | no |

## Example (curl)

```bash
curl -X PATCH "https://browlix.com/api/public/v1/webhooks/<id>" \
  -H "Authorization: Bearer $BROWLIX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"command_id":"<uuid>"}'
```

## Example (TypeScript SDK)

```ts
import { Browlix } from "@browlix/sdk";

const bx = new Browlix({ apiKey: process.env.BROWLIX_API_KEY! });
const reply = await bx.call("webhooks.update", { path: { id: "<id>" }, body: {} });
console.log(reply.data);
```

## Example (Python)

```python
import os, uuid
import requests

r = requests.patch(
    "https://browlix.com/api/public/v1/webhooks/<id>",
    headers={"Authorization": f"Bearer {os.environ['BROWLIX_API_KEY']}"},
    json={"command_id":str(uuid.uuid4())},
    timeout=60,
)
print(r.status_code, r.json())
```

## Example (MCP)

```json
{
  "method": "tools/call",
  "params": {
    "name": "webhooks_update",
    "arguments": {
      "id": "<id>"
    }
  }
}
```
