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

# Update a webhook

`PATCH /v1/webhooks/{id}`

## Request

- Base URL: `https://botmail.pro`
- URL: `https://botmail.pro/v1/webhooks/{id}`
- Auth: one of:
  - HTTP bearer
  - API key in cookie `bm_session`

Scope: manage. Setting `active: true` re-enables a disabled webhook and resets `failures`.

## Request body

- object
  - `active` boolean
  - `events` EventType[]

## Response `200`

The updated webhook.

- Webhook
  - `id` string, required
  - `url` string, uri, required
  - `mailbox_id` string, nullable, required: Null = every mailbox.
  - `events` EventType[], required
  - `active` boolean, required
  - `failures` integer, required: Consecutive failures; disabled at 20.
  - `last_seq` integer, required: Last event delivered.
  - `disabled_reason` string, nullable, required
  - `created_at` string, date-time, required
  - `last_delivery_at` string, date-time, nullable, required

## Other responses

- `400`: Invalid request (`bad_request` or a more specific code).
- `401`: Missing or invalid credentials (`unauthorized`, `invalid_token`).
- `403`: The credential can't do this (`forbidden`, `csrf`, `account_inactive`, …). Missing scopes are listed in `details.required_scope`; pending keys get a hint to wait for the claim.
- `404`: Not found or not accessible with this credential.
- `422`: Well-formed but rejected; see `code` and `hint`.

---

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