# molted webhooks

Source: https://molted.email/docs/cli/webhooks

Manage webhook endpoints for real-time event notifications

| Command | Description |
| - | - |
| [`molted webhooks create`](#molted-webhooks-create) | Register a new webhook endpoint |
| [`molted webhooks list`](#molted-webhooks-list) | List all webhook endpoints |
| [`molted webhooks get`](#molted-webhooks-get) | Get webhook endpoint details |
| [`molted webhooks update`](#molted-webhooks-update) | Update a webhook endpoint (as an agent in an enforce workspace only the description, or `--enabled` true on a webhook that is already on or that your own key turned off, unless your key created the webhook; turning back on one a person (or another key, or the system) turned off, disabling or redirecting one is for a person) |
| [`molted webhooks delete`](#molted-webhooks-delete) | Delete a webhook endpoint (in an enforce workspace only the key that created it can; otherwise a person does it) |
| [`molted webhooks deliveries`](#molted-webhooks-deliveries) | List recent deliveries for a webhook endpoint |
| [`molted webhooks test`](#molted-webhooks-test) | Send a test event to a webhook endpoint |
| [`molted webhooks listen`](#molted-webhooks-listen) | Removed: use `molted listen` to stream events over SSE instead |

## Agent context

Webhooks push real-time event notifications to your URL. molted.email can't deliver webhooks to a localhost URL, so there is no local dev server here: use `molted listen` to stream events over SSE during development instead.

### Create a webhook

```bash
molted webhooks create --url https://example.com/hooks/molted
molted webhooks create --url https://example.com/hooks --events inbound.received,delivery.bounced
molted webhooks create --url https://example.com/hooks --auth-type bearer --bearer-token <token>
```

### List webhooks

```bash
molted webhooks list
```

### Test a webhook

```bash
molted webhooks test --id <webhookId>
```

### Local dev streaming

```bash
molted listen
molted listen --events inbound.received
```

Events: inbound.received, inbound.classified, inbound.routed, inbound.released,\
delivery.sent, delivery.delivered, delivery.bounced, delivery.complained, suppression.created,\
thread.labeled, thread.unlabeled, label.deleted

Auth types (`--auth-type`):\
hmac    (default) — signs payload with X-Molted-Signature bearer            — sends Authorization: Bearer \<token> (requires https) both              — sends both headers

Each delivery includes:\
X-Molted-Event: \<event type>\
X-Molted-Delivery: \<delivery UUID>\
X-Molted-Signature: sha256=\<HMAC of body> (auth-type hmac|both)\
Authorization: Bearer \<token>             (auth-type bearer|both)

The signing secret (whsec\_...) for X-Molted-Signature is returned in full only by webhooks create; webhooks get shows just its prefix.

Related: [`molted listen`](https://molted.email/docs/cli/listen.md), [`molted events`](https://molted.email/docs/cli/events.md)

## Commands

### molted webhooks create

Register a new webhook endpoint

```bash
molted webhooks create [options]
```

| Option | Description | Default |
| - | - | - |
| `--url <url>` | URL to receive webhook events (required) (required) | |
| `--events <events>` | Comma-separated event types (empty = all events) | |
| `--description <desc>` | Description for this endpoint | |
| `--auth-type <type>` | hmac (default), bearer, or both | |
| `--bearer-token <token>` | Bearer token sent in Authorization header (required when `--auth-type` is bearer or both) | |

### molted webhooks list

List all webhook endpoints

```bash
molted webhooks list
```

### molted webhooks get

Get webhook endpoint details

```bash
molted webhooks get [options]
```

| Option | Description | Default |
| - | - | - |
| `--id <id>` | Webhook endpoint ID (required) (required) | |

### molted webhooks update

Update a webhook endpoint (as an agent in an enforce workspace only the description, or `--enabled` true on a webhook that is already on or that your own key turned off, unless your key created the webhook; turning back on one a person (or another key, or the system) turned off, disabling or redirecting one is for a person)

```bash
molted webhooks update [options]
```

| Option | Description | Default |
| - | - | - |
| `--id <id>` | Webhook endpoint ID (required) (required) | |
| `--url <url>` | New URL | |
| `--events <events>` | Comma-separated event types | |
| `--enabled <bool>` | Enable or disable | |
| `--description <desc>` | Description | |
| `--auth-type <type>` | hmac, bearer, or both | |
| `--bearer-token <token>` | Bearer token sent in Authorization header (use "null" to clear) | |

### molted webhooks delete

Delete a webhook endpoint (in an enforce workspace only the key that created it can; otherwise a person does it)

```bash
molted webhooks delete [options]
```

| Option | Description | Default |
| - | - | - |
| `--id <id>` | Webhook endpoint ID (required) (required) | |

### molted webhooks deliveries

List recent deliveries for a webhook endpoint

```bash
molted webhooks deliveries [options]
```

| Option | Description | Default |
| - | - | - |
| `--id <id>` | Webhook endpoint ID (required) (required) | |

### molted webhooks test

Send a test event to a webhook endpoint

```bash
molted webhooks test [options]
```

| Option | Description | Default |
| - | - | - |
| `--id <id>` | Webhook endpoint ID (required) (required) | |

### molted webhooks listen

Removed: use `molted listen` to stream events over SSE instead

```bash
molted webhooks listen [options]
```

| Option | Description | Default |
| - | - | - |
| `--port <port>` | Removed, ignored | |
| `--events <events>` | Removed, ignored | |

See [CLI overview](https://molted.email/docs/cli.md) for global options, credentials and output format.
