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

# Update a webhook subscription

`PATCH /webhooks/{webhook_id}`

## Request

- Base URL: `http://localhost:8000`
- URL: `http://localhost:8000/webhooks/{webhook_id}`
- Auth: API key in header `API-Key`

Partially updates a subscription. Omitted secrets retain their stored values.

A supplied `url` must include an endpoint path; the rule applies to the URL being saved, so a subscription stored with a bare URL keeps working until its URL is changed.

Required scope: `webhooks:write`

## Path parameters

- `webhook_id` string, uuid, required

## Request body

- UpdateWebhookSubscriptionRequest: Patch request for updating a webhook subscription. At least one field should be provided.
  - `name` string
  - `url` string, uri: Delivery endpoint. Must be an `http` or `https` URL that includes an endpoint path, for example `https://api.example.com/webhooks/events`. A bare origin with no path (or a path of just `/`) is rejected.
  - `enabled` boolean
  - `source` 'keycloak' | 'platform'
  - `event_types` string[]
  - `signing_secret` string, password
  - `cluster_id` string, uuid
  - `realm_id` string, uuid: Keycloak realm ID. This is a UUID generated by Keycloak.
  - `authorization_header` string, password

## Response `200`

The request has succeeded.

- WebhookSubscription: Saved webhook subscription for the authenticated workspace.
  - `id` string, uuid, required
  - `name` string, required
  - `url` string, required
  - `enabled` boolean, required
  - `source` 'keycloak' | 'platform', required
  - `event_types` string[], required
  - `cluster_id` string, uuid
  - `realm_id` string
  - `has_authorization_header` boolean, required
  - `has_signing_secret` boolean, required
  - `created_at` string, date-time, required
  - `updated_at` string, date-time, required

## Other responses

- `400`: The server could not understand the request due to invalid syntax.
- `401`: Access is unauthorized.
- `402`: Client error
- `403`: Access is forbidden.
- `404`: The server cannot find the requested resource.
- `422`: Client error
- `429`: Client error
- `500`: Server error
- `501`: Server error

---

[API](https://skmtc.dev/skycloak/apis/skycloak-public-api.md) · [All operations](https://skmtc.dev/skycloak/apis/skycloak-public-api/llms.txt) · [OpenAPI document](https://skmtc.dev/skycloak/apis/skycloak-public-api/revisions/33a69e2ce35f?raw)
