# Update webhook

`opensend webhooks update`

Changes the address, the events or whether an endpoint is switched on.

Needs the scope: `webhooks:write`

## Flags

- `<id>` (string, required): The id of the item. Up to 64 characters.
- `--url` (string): A new address. Up to 500 characters.
- `--events` (string[]): The events to be told about from now on. One of: `email.sent`, `email.delivered`, `email.delayed`, `email.bounced`, `email.opened`, `email.clicked`, `email.complained`, `email.failed`, `email.received`, `email.scheduled`, `email.canceled`, `automation.entered`, `automation.finished`, `automation.step`.
- `--status` (string): `enabled` to post events, `disabled` to stop. One of: `enabled`, `disabled`.
- `--format` (string): `native` or `resend`: how events are written and signed from now on. One of: `native`, `resend`.

## Returns

The command prints the answer: as JSON when its output goes to a file or another program, and as a table or a list of fields in a terminal. When the API refuses, the error goes to the error stream and the command ends with a code that names the failure. [Output and scripts](https://opensend.sh/docs/scripting) lists the codes.

- `object` ("webhook"): Always `webhook`.
- `id` (string): The id of the webhook.
- `url` (string): The address events are posted to.
- `events` (string[]): The events it is told about. One of: `email.sent`, `email.delivered`, `email.delayed`, `email.bounced`, `email.opened`, `email.clicked`, `email.complained`, `email.failed`, `email.received`, `email.scheduled`, `email.canceled`, `automation.entered`, `automation.finished`, `automation.step`.
- `status` (string): `enabled` while events are posted to it, `disabled` when it is switched off. One of: `enabled`, `disabled`.
- `format` (string): How an event is written and signed: `native` is this API, `resend` is the headers, signature and body an endpoint built for Resend expects. One of: `native`, `resend`.
- `lastDeliveryAt` (string | null): When an event was last posted to it, or `null`.
- `lastStatus` (integer | null): The HTTP status your address answered with last time, or `null`.
- `createdAt` (string): When the webhook was added.

## Example

CLI:

```bash
opensend webhooks update wh_01 --status disabled
```

Answer:

```json
{
  "object": "webhook",
  "id": "wh_01",
  "url": "https://example.com/webhooks/mail",
  "events": [
    "email.sent",
    "email.delivered",
    "email.delayed",
    "email.bounced",
    "email.opened",
    "email.clicked",
    "email.complained",
    "email.failed",
    "email.received",
    "email.scheduled",
    "email.canceled",
    "automation.entered",
    "automation.finished",
    "automation.step"
  ],
  "status": "disabled",
  "format": "native",
  "lastDeliveryAt": "2026-11-27T09:30:00.000Z",
  "lastStatus": 200,
  "createdAt": "2026-11-27T09:30:00.000Z"
}
```
