# Update webhook

```http
PATCH /projects/{project_reference}/webhooks/{webhook_id}
```

Change the name, target, prompt template, event filter or status of a webhook, for example to enable or disable deliveries; returns the updated webhook. Requires project.agents.write.

## Parameters

| Name                | In   | Required | Description                                                                                                                                                                                               |
| ------------------- | ---- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `project_reference` | path | Yes      |                                                                                                                                                                                                           |
| `webhook_id`        | path | Yes      | The webhook id. Updates require project.agents.write. When target is omitted, a stored conversation-backed target (create\_new or existing conversation mode) still requires project.conversations.write. |

## Request body

| Field             | Type        | Required | Description                                                                            |
| ----------------- | ----------- | -------- | -------------------------------------------------------------------------------------- |
| `name`            | string      |          | New webhook name, 1-120 characters.                                                    |
| `target`          | object      |          | Target invoked by a webhook definition.                                                |
| `prompt_template` | string      |          | Prompt template for run targets. Not supported for event-only webhooks.                |
| `event_filter`    | object,null |          | Optional incoming event filter. Missing, null, or empty conditions accept every event. |
| `status`          | string      |          | draft, enabled or disabled.                                                            |

## Responses

| Status | Description                                                                                                |
| ------ | ---------------------------------------------------------------------------------------------------------- |
| 200    | Updated webhook metadata or status.                                                                        |
| 400    | invalid\_input: invalid body or parameters                                                                 |
| 401    | unauthenticated                                                                                            |
| 403    | forbidden: a project member without the required capability                                                |
| 404    | not\_found: project or webhook not found or not visible                                                    |
| 500    | internal                                                                                                   |
| 503    | internal: authentication state is temporarily unavailable and the request was not processed; retry shortly |
