---
title: "Update a webhook"
method: PATCH
path: "/webhook/{id}"
tags: ["Webhooks"]
---

# Update a webhook

`PATCH /webhook/{id}`

Update a webhook's endpoint URL, description, or custom headers. At
least one of the three fields must be present in the request body.

**Event subscriptions cannot be changed here.** To add or remove an
agent's subscription to this webhook, use `POST /agent/{agentId}/webhook-subscriptions`
and `DELETE /agent/{agentId}/webhook-subscriptions`.

**Custom `headers` behavior**
- Send a non-empty object to replace all custom headers on the webhook.
- Send an empty object (`{}`) to clear all custom headers.
- Omit the field to leave existing custom headers untouched.

Custom header limits: at most 10 headers per webhook, values up to
1024 characters, header names must match RFC 7230 token syntax. The
following names are reserved and rejected: `x-signature`, `host`,
`content-length`, `content-type`, `connection`, `transfer-encoding`.

## Path parameters

- `id` string, required

## Request body

- object
  - `endpoint` string, uri — New endpoint URL. Must be a valid URL.
  - `description` string — New human-readable label.
  - `headers` object — Map of custom header names to values. Non-empty object replaces all existing headers; empty object clears them.

## Response `200`

Webhook updated successfully.

- object
  - `status` boolean
  - `data` string — The ID of the updated webhook.

## Other responses

- `400` — Invalid input
- `401` — Unauthorized access
- `404` — Webhook not found.
- `500` — Internal server error

---

[API](https://skmtc.net/smallest-inc/apis/agent-management-api.md) · [All operations](https://skmtc.net/smallest-inc/apis/agent-management-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/smallest-inc/agent-management-api/revisions/c2d0eb64b01a/schema)
