---
title: "Rename a Webhook, change its enabled state, or rotate its secret"
method: PATCH
path: "/api/v1/webhooks/{webhookId}"
---

# Rename a Webhook, change its enabled state, or rotate its secret

`PATCH /api/v1/webhooks/{webhookId}`

## Request

- Base URL: `https://charm.ing`
- URL: `https://charm.ing/api/v1/webhooks/{webhookId}`
- Auth: HTTP bearer

Session-gated; requires `app:write` on the webhook's app. Re-enable is `{enabled: true}` — not a separate action — and resets the consecutive-failure counter. `{rotate_secret: true}` replaces the secret immediately and returns the new one once. `name` relabels the Webhook.

## Request body

- object
  - `enabled` boolean
  - `rotate_secret` boolean
  - `name` string

## Response `200`

Webhook updated. `secret` is present only after a rotation.

- WebhookResponse
  - `ok` true, required
  - `webhook` Webhook, required: A declared op an external sender invokes by POSTing to `url` with the Webhook secret. The body is the op’s input.
    - `id` string, required: Public id, `webhook_<uuid>` form.
    - `app_id` string, uuid, required
    - `op` string, required
    - `name` string, required: The owner’s label; defaults to the op’s title, description, or identifier.
    - `url` string, required: The delivery URL an external sender POSTs to.
    - `secret_prefix` string, required: First characters of the secret, for matching a stored copy by eye.
    - `enabled` boolean, required
    - `disabled_reason` 'owner' | 'null', nullable, required
    - `last_run_at` string, date-time, nullable, required
    - `last_outcome` string, nullable, required
    - `last_error` object, nullable, required
      - `kind` string, required
      - `message` string, required
    - `consecutive_failures` integer, required
  - `secret` string: Present only when the update rotated the secret. Shown once.

## Other responses

- `400`: Invalid body.
- `401`: Sign-in required.
- `404`: Webhook not found, or the caller lacks `app:write` on its app.

---

[API](https://skmtc.dev/charm/apis/charming-api.md) · [All operations](https://skmtc.dev/charm/apis/charming-api/llms.txt) · [OpenAPI document](https://skmtc.dev/charm/apis/charming-api/revisions/a9d06c419b3a?raw)
