---
title: "Edit a webhook"
method: PATCH
path: "/v1/webhooks/{webhook_id}"
tags: ["webhooks"]
---

# Edit a webhook

`PATCH /v1/webhooks/{webhook_id}`

## Request

- Base URL: `https://cherami.to`
- URL: `https://cherami.to/v1/webhooks/{webhook_id}`
- Auth: HTTP bearer

Changes the event types, inbox scope or enabled state. The URL can't be edited: add a webhook with the new URL, then delete this one.

Values are absolute, so a lost or uncertain change is safe to repeat with the same values.

## Path parameters

- `webhook_id` string, required

## Request body

- UpdateWebhook: Omitted fields stay as they are, and a supplied array replaces the whole list.
  - `event_types` WebhookEventType[]
  - `inbox_ids` string[]: Replaces the scope with up to 10 of the account's live inboxes; [] means every inbox, including ones created later. Omit it to keep the current scope.
  - `enabled` boolean: false pauses deliveries; true resumes them, including after repeated delivery failures disabled the webhook.

## Response `200`

Success.

- Webhook: status is active (delivering), disabled (not delivering until you set enabled to true; you or repeated delivery failures turned it off), pending (creation or removal not yet confirmed; read it again shortly) or unknown (the configuration couldn't be read and its fields are null; if it stays unknown, delete the webhook and add it again). pending_operation names the unconfirmed work.
  - `id` string, required: Cherami resource ID.
  - `created_at` string, date-time, required: UTC timestamp with milliseconds.
  - `url` string, nullable, required: Destination URL; null while status is pending or unknown.
  - `event_types` WebhookEventType[], nullable, required
  - `inbox_ids` string[], nullable, required: Scoped inboxes; empty means every inbox.
  - `deleted_inbox_ids` string[], required: Scoped inboxes that have since been deleted. They match nothing; edit inbox_ids to remove them.
  - `enabled` boolean, nullable, required
  - `updated_at` string, date-time, nullable, required: UTC timestamp with milliseconds.
  - `status` 'active' | 'disabled' | 'pending' | 'unknown', required
  - `pending_operation` object, nullable, required
    - `kind` 'create' | 'delete' | 'rotate', required
    - `started_at` string, date-time, required: UTC timestamp with milliseconds.
  - `secret_rotated_at` string, date-time, nullable, required: UTC timestamp with milliseconds.
  - `previous_secret_expires_at` string, date-time, nullable, required: UTC timestamp with milliseconds.

## Other responses

- `400`: `invalid_json`: Send a valid UTF-8 JSON object, not an array or scalar. `invalid_webhook_update`: Supply at least one of `event_types`, `inbox_ids` and `enabled`, with `enabled` as a boolean. `invalid_webhook_event_types`: Supply a nonempty array of `message.received`, `message.sent` or both. `invalid_webhook_inbox_ids`: Supply `inbox_ids` as an array of at most 10 inbox IDs, or an empty array for every inbox. `unknown_webhook_inbox`: An `inbox_ids` entry is not a live inbox of this account. Remove the IDs listed in `error.details.inbox_ids`. `invalid_webhook_settings`: The settings were refused, and nothing changed. Read the webhook, then send corrected values.
- `401`: `unauthorized`: Send a valid API key as `Authorization: Bearer <key>`. If the key stopped working, get a new one through [recovery](https://cherami.to/docs/guides/recovery).
- `404`: `not_found`: The resource does not exist or does not belong to this account. A reply or forward source must also be in the sending inbox.
- `409`: `webhook_operation_in_progress`: Another change to this webhook is in progress. Retry in a minute. `webhook_endpoint_missing`: This webhook no longer receives events and cannot be changed. Delete it and add it again; the new webhook has a new ID and signing secret.
- `413`: `body_too_large`: Reduce the JSON request to the operation's body limit.
- `415`: `unsupported_media_type`: Send `Content-Type: application/json`.
- `503`: `webhook_provider_unavailable`: The request could not be completed, and nothing changed. Retry later. `webhook_settings_uncertain`: The settings change was not confirmed. Apply the same values again; repeating them is safe. `webhooks_unavailable`: Webhook management failed. If it was a change, it may have been applied: list or read the webhooks before repeating it.

---

[API](https://skmtc.dev/cherami/apis/cherami-http-api.md) · [All operations](https://skmtc.dev/cherami/apis/cherami-http-api/llms.txt) · [OpenAPI document](https://skmtc.dev/cherami/apis/cherami-http-api/revisions/7bd993d538af?raw)
