---
title: "Update Webhook"
url: "https://docs.yoagent.dev/reference/rest-api/operations/updatewebhook"
---

# Update Webhook

PATCH

/v0/webhooks/{webhook_id}

```sh
curl -s -X PATCH "https://api.yoagent.dev/v0/webhooks/whk_01je56wqswfmn9pgbc1wq8tjgq" \
  -H "Authorization: Bearer $YOAGENT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"enabled":true}'
```

```js
const response = await fetch("https://api.yoagent.dev/v0/webhooks/whk_01je56wqswfmn9pgbc1wq8tjgq", {
  method: "PATCH",
  headers: {
    Authorization: `Bearer ${process.env.YOAGENT_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "enabled": true
  }),
});
if (!response.ok) throw new Error(await response.text());
const data = await response.json();
```

```python
import os

import requests

response = requests.patch(
    "https://api.yoagent.dev/v0/webhooks/whk_01je56wqswfmn9pgbc1wq8tjgq",
    headers={"Authorization": f"Bearer {os.environ['YOAGENT_KEY']}"},
    json={
        "enabled": True,
    },
    timeout=60,
)
response.raise_for_status()
data = response.json()
```

- api.yoagent.dev/v0/webhooks/{webhook_id}

Pause or turn on a webhook, replace its events or its inboxes (the whole new list); its URL and scope never change.

## Authorizations

- **[ApiKey](https://docs.yoagent.dev/reference/rest-api#apikey)**

## Parameters

### Path Parameters

**webhook_id**

required

_Webhook Id_

string

/^whk\_\[0-7]\[0-9a-hjkmnp-tv-z]{25}$/

## Request Body required

application/json

_WebhookUpdate_

Change a webhook; omitted fields stay as they are. Its URL and scope never change: make another one.

object

**enabled**

_Enabled_

False pauses it (nothing is sent, nor later); true turns it on again, also after we paused it.

Any of:

**boolean**

boolean

**null**

null

**event_types**

_Event Types_

Replaces the list.

Any of:

**Array\<string>**

Array\<string>

\>= 1 items

Allowed values: domain.verified message.bounced message.complained message.delivered message.received message.rejected message.sent message.unsubscribed

**null**

null

**inbox_ids**

_Inbox Ids_

The whole new list of its inboxes, replacing the old (scope `inboxes` only; 1 to 100); omitted: they stay.

Any of:

**Array\<string>**

Array\<string>

\>= 1 items <= 100 items

**null**

null

## Responses

### 200

Successful Response

application/json

_WebhookOut_

A webhook; `secret` verifies the `webhook-signature` header (Standard Webhooks).

object

**version**

required

_Version_

Goes up by one on every change: of two copies, the one with the higher version is the newer.

integer

**webhook_id**

required

_Webhook Id_

string

/^whk\_\[0-7]\[0-9a-hjkmnp-tv-z]{25}$/

**project_id**

required

_Project Id_

string

/^prj\_\[0-7]\[0-9a-hjkmnp-tv-z]{25}$/

**url**

required

_Url_

Where it POSTs; whole (with its user and password, sent as Basic auth, its path and query) only to a caller who may create the project’s webhooks (`webhook_create`), like `secret`; to others its scheme, host and port.

string

**event_types**

required

_Event Types_

Array\<string>

Allowed values: domain.verified message.bounced message.complained message.delivered message.received message.rejected message.sent message.unsubscribed

**scope**

required

_WebhookScope_

What mail of its project a webhook receives.

string

Allowed values: project inboxes catch_all

**inboxes**

required

_Inboxes_

The inboxes of scope `inboxes` (empty once they are all deleted: it then receives nothing).

Array\<object>

_WebhookInboxOut_

An inbox a webhook is limited to.

object

**inbox_id**

required

_Inbox Id_

string

/^inb\_\[0-7]\[0-9a-hjkmnp-tv-z]{25}$/

**address**

required

_Address_

Null when the caller does not see the inbox; its local part may come from a sender (auto-create).

Any of:

**string**

string

**null**

null

**enabled**

required

_Enabled_

boolean

**disabled_reason**

required

`failing`: we paused it after its URL failed deliveries in a row (how many: the webhooks’ event docs); null when on or paused by a person.

Any of:

**DisabledReason**

_DisabledReason_

Why a webhook is paused by us rather than by a person.

string

Allowed values: failing

**null**

null

**client_id**

required

_Client Id_

Any of:

**string**

string

**null**

null

**secret**

required

_Secret_

Shown to a caller who may create the project’s webhooks (`webhook_create`); null for one who may only read them.

Any of:

**string**

string

**null**

null

**editable**

required

_Editable_

Whether the caller may pause it, turn it on and change it (`webhook_update` in its project).

boolean

**deletable**

required

_Deletable_

Whether the caller may delete it (`webhook_delete` in its project).

boolean

**created_at**

required

_Created At_

string format: date-time

#### Example

```json
{
  "version": 1,
  "webhook_id": "whk_01je56wqswfmn9pgbc1wq8tjgq",
  "project_id": "prj_01je56wqswfmn9pgbc1wq8tjgq",
  "url": "https://ci.example.com/hooks/yoagent",
  "event_types": [
    "domain.verified"
  ],
  "scope": "project",
  "inboxes": [],
  "enabled": true,
  "disabled_reason": null,
  "client_id": "ci-run-1842",
  "secret": "whsec_…",
  "editable": true,
  "deletable": true,
  "created_at": "2026-12-01T12:00:00Z"
}
```

### default

An error (400, 401, 403, 404, 405, 409, 413, 429, 500, 503), in the one shape every call answers: [Errors](https://docs.yoagent.dev/reference/conventions#errors).
