# molted inbound-hooks

Source: https://molted.email/docs/cli/inbound-hooks

Manage inbound webhook mappings for zero-code integrations

| Command | Description |
| - | - |
| [`molted inbound-hooks create`](#molted-inbound-hooks-create) | Create an inbound webhook mapping |
| [`molted inbound-hooks list`](#molted-inbound-hooks-list) | List all inbound webhook mappings |
| [`molted inbound-hooks get`](#molted-inbound-hooks-get) | Get an inbound webhook mapping by ID |
| [`molted inbound-hooks update`](#molted-inbound-hooks-update) | Update an inbound webhook mapping |
| [`molted inbound-hooks delete`](#molted-inbound-hooks-delete) | Delete an inbound webhook mapping |
| [`molted inbound-hooks logs`](#molted-inbound-hooks-logs) | View recent webhook delivery logs |
| [`molted inbound-hooks test`](#molted-inbound-hooks-test) | Dry-run a sample payload against a webhook mapping: no side effects |

## Agent context

Inbound webhook mappings let you connect external services (Clerk, Stripe, Supabase Auth, etc.) to Molted without writing code.

### Setup flow

```bash
molted inbound-hooks create \
  --name "Clerk Signups" \
  --email-path "data.email_addresses[0].email_address" \
  --field-map "name=data.first_name" \
  --action "sync_contact" \
  --action "subscribe_to_list:<listId>"
# -> returns the mapping with a unique urlToken (ink_...); paste
#    https://api.molted.email/v1/hooks/<urlToken> into your provider

molted inbound-hooks list
molted inbound-hooks get <id>
molted inbound-hooks update <id> --enabled false
molted inbound-hooks delete <id>
molted inbound-hooks logs <id>   # recent deliveries and errors
molted inbound-hooks test <id> --payload '{"data":{"email":"a@b.com"}}'
                                  # dry run: shows extracted fields and the
                                  # actions it would take, no side effects
```

Action types:\
sync\_contact                    Upsert the contact: name from the "name" (or

```bash
"firstName") mapping, every mapped field
```

merged into its metadata\
subscribe\_to\_list:\<id>          Subscribe contact to a list subscribe\_to\_list:\<id>:confirm  Same, but require double opt-in (a pending\
contact must confirm via email before they\
go active -- see the confirmation journey\
docs). An unsubscribed or suppressed\
address is never reactivated by a\
resubmission either way.\
trigger\_journey:\<event>         Fire an event to start a journey

Email path syntax uses dot notation with array indices:\
data.email                          simple field\
data.email\_addresses\[0].email       nested array

Security model:\
The receiver URL is authenticated by the URL token alone. Anyone with the URL can trigger actions, so treat tokens as secrets. Delete and recreate if leaked. Per-token rate limit: 120 requests/minute (429 when exceeded).

Related: [`molted contacts`](https://molted.email/docs/cli/contacts.md), [`molted lists`](https://molted.email/docs/cli/lists.md), [`molted journeys`](https://molted.email/docs/cli/journeys.md)

## Commands

### molted inbound-hooks create

Create an inbound webhook mapping

```bash
molted inbound-hooks create [options]
```

| Option | Description | Default |
| - | - | - |
| `--name <name>` | Display name for this webhook (required) | |
| `--email-path <path>` | JSON path to extract email from payload (required) | |
| `--source <source>` | Source service name (clerk, stripe, etc.) | |
| `--field-map <mapping...>` | Field mappings (key=path format) (variadic) | |
| `--action <action...>` | Actions to execute (type or type:param) (variadic) | |

### molted inbound-hooks list

List all inbound webhook mappings

```bash
molted inbound-hooks list
```

### molted inbound-hooks get

Get an inbound webhook mapping by ID

```bash
molted inbound-hooks get <id>
```

| Argument | Description | Required |
| - | - | - |
| `<id>` | | yes |

### molted inbound-hooks update

Update an inbound webhook mapping

```bash
molted inbound-hooks update [options] <id>
```

| Argument | Description | Required |
| - | - | - |
| `<id>` | | yes |

| Option | Description | Default |
| - | - | - |
| `--name <name>` | Display name | |
| `--email-path <path>` | JSON path to extract email | |
| `--source <source>` | Source service name | |
| `--field-map <mapping...>` | Field mappings (key=path format) (variadic) | |
| `--action <action...>` | Actions to execute (replaces existing) (variadic) | |
| `--enabled <value>` | Enable or disable (true/false) | |

### molted inbound-hooks delete

Delete an inbound webhook mapping

```bash
molted inbound-hooks delete <id>
```

| Argument | Description | Required |
| - | - | - |
| `<id>` | | yes |

### molted inbound-hooks logs

View recent webhook delivery logs

```bash
molted inbound-hooks logs [options] <id>
```

| Argument | Description | Required |
| - | - | - |
| `<id>` | | yes |

| Option | Description | Default |
| - | - | - |
| `--limit <n>` | Number of logs to show | `20` |

### molted inbound-hooks test

Dry-run a sample payload against a webhook mapping: no side effects

```bash
molted inbound-hooks test [options] <id>
```

| Argument | Description | Required |
| - | - | - |
| `<id>` | | yes |

| Option | Description | Default |
| - | - | - |
| `--payload <json\|@file>` | Sample payload as a JSON string, or @path/to/file.json (required) | |

Shows the email and fields the mapping would extract from the sample payload, and the actions it would take -- without upserting a contact, subscribing to a list, triggering a journey, or writing a delivery log.

#### Examples

```bash
molted inbound-hooks test wh_abc --payload '{"data":{"email":"a@b.com","first_name":"Ada"}}'
molted inbound-hooks test wh_abc --payload @sample-clerk-payload.json
```

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