# kindgi webhooks

> Start flow runs from signed webhooks (WooCommerce, Drupal, GitHub, Shopify, Standard Webhooks): register, list, get, update, pause, resume, fires, take-ownership, unregister

## `kindgi webhooks`

**Synopsis**

```sh signature
kindgi webhooks <command>
```

Start flow runs from signed webhooks (WooCommerce, Drupal, GitHub, Shopify, Standard Webhooks): register, list, get, update, pause, resume, fires, take-ownership, unregister.

**Commands**

| Command                                                                                                                     | Description                                                                                                                                                                    |
| --------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| [`kindgi webhooks register`](https://docs.kindgi.com/v0.1.9/reference/cli/webhooks.md#kindgi-webhooks-register)             | Start a flow's run when a signed request arrives: from WooCommerce, Drupal's Webhooks module, GitHub, Shopify, or any sender that signs with HMAC-SHA256 or Standard Webhooks. |
| [`kindgi webhooks list`](https://docs.kindgi.com/v0.1.9/reference/cli/webhooks.md#kindgi-webhooks-list)                     | List webhook triggers.                                                                                                                                                         |
| [`kindgi webhooks get`](https://docs.kindgi.com/v0.1.9/reference/cli/webhooks.md#kindgi-webhooks-get)                       | Fetch a webhook trigger, with its receive URL.                                                                                                                                 |
| [`kindgi webhooks update`](https://docs.kindgi.com/v0.1.9/reference/cli/webhooks.md#kindgi-webhooks-update)                 | Change a webhook trigger: its flow version, input, secret, scheme, delivery-id header or limits.                                                                               |
| [`kindgi webhooks pause`](https://docs.kindgi.com/v0.1.9/reference/cli/webhooks.md#kindgi-webhooks-pause)                   | Pause a webhook trigger.                                                                                                                                                       |
| [`kindgi webhooks resume`](https://docs.kindgi.com/v0.1.9/reference/cli/webhooks.md#kindgi-webhooks-resume)                 | Resume a paused webhook trigger: deliveries start runs again.                                                                                                                  |
| [`kindgi webhooks fires`](https://docs.kindgi.com/v0.1.9/reference/cli/webhooks.md#kindgi-webhooks-fires)                   | A webhook trigger's deliveries, newest first: the run each started, or why it was skipped (paused) or refused (a wrong or missing signature, a stale one, the limits, …).      |
| [`kindgi webhooks take-ownership`](https://docs.kindgi.com/v0.1.9/reference/cli/webhooks.md#kindgi-webhooks-take-ownership) | Become a webhook trigger's owner, so its runs act as you from the next delivery (for a trigger whose owner left).                                                              |
| [`kindgi webhooks unregister`](https://docs.kindgi.com/v0.1.9/reference/cli/webhooks.md#kindgi-webhooks-unregister)         | Remove a webhook trigger: its sender is answered 410 from now on.                                                                                                              |

**See also**

- [Start runs from WooCommerce, Drupal or any signed webhook](https://docs.kindgi.com/v0.1.9/guides/webhooks/start-runs-from-webhooks.md)

### `kindgi webhooks register`

**Synopsis**

```sh signature
kindgi webhooks register --flow=<id> --flow-version=<v> --secret=<name> [--generate-secret] [--preset=woocommerce|drupal-webhooks|github|shopify|standard-webhooks | --signature-header=<h> --signature-encoding=hex|base64 [--signature-prefix=<p>]] [--delivery-id-header=<h>] [--input=<json-or-@file>] [--project=<project-id>] [--body-limit=<bytes>] [--rate-limit=<per-minute>] [--label=<text>] [--run-as=<service-account-id>]
```

Start a flow's run when a signed request arrives: from WooCommerce, Drupal's Webhooks module, GitHub, Shopify, or any sender that signs with HMAC-SHA256 or Standard Webhooks. Its runs act as you, checked again at every delivery. The event the flow gets is data from outside, never instructions: check it in a step before any agent, and keep the agent that reads it read-only.

**Options**

| Option                         | Default                                                                               | Description                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| ------------------------------ | ------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `--body-limit <value>`         | `262144` bytes (256 KiB)                                                              | The largest body it takes, in bytes (1024 to 1048576; default 262144).                                                                                                                                                                                                                                                                                                                                                                                |
| `--delivery-id-header <value>` | none, or the header the preset sets                                                   | The header whose value, with the body, dedupes deliveries (a preset sets it; `none` on update stops deduping).                                                                                                                                                                                                                                                                                                                                        |
| `--flow <value>`               | required                                                                              | The flow each delivery starts.                                                                                                                                                                                                                                                                                                                                                                                                                        |
| `--flow-version <value>`       | required                                                                              | The flow version.                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| `--generate-secret`            | none                                                                                  | The runtime makes a new signing secret, stores it as --secret in the trigger's project, and shows it once, to paste into the sender. Letters and digits only (WooCommerce HTML-decodes its secret); `whsec_…` with --preset=standard-webhooks.                                                                                                                                                                                                        |
| `--input <value>`              | none (the flow gets the event)                                                        | The flow's input on every delivery, in place of the event, as JSON or `@<file>` (default: the event).                                                                                                                                                                                                                                                                                                                                                 |
| `--label <value>`              | none                                                                                  | A short label.                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| `--preset <value>`             | none (with no `--signature-header` either: a hex HMAC-SHA256 in `X-Kindgi-Signature`) | How the sender signs, by sender: woocommerce\|drupal-webhooks\|github\|shopify\|standard-webhooks. Sets the scheme and the delivery-id header.                                                                                                                                                                                                                                                                                                        |
| `--project <value>`            | the tenant's Default project                                                          | The trigger's project, by id (default: the tenant's Default project).                                                                                                                                                                                                                                                                                                                                                                                 |
| `--rate-limit <value>`         | `600` a minute                                                                        | Accepted deliveries a minute (1 to 6000; default 600); past it, 429.                                                                                                                                                                                                                                                                                                                                                                                  |
| `--run-as <value>`             | none (you own the trigger)                                                            | A service account, by id: the trigger's owner, so its runs act as that account from the next delivery (not as you). Needs `act_as` on the account; omit it to own the trigger yourself.                                                                                                                                                                                                                                                               |
| `--secret <value>`             | required                                                                              | The signing secret's name: one written with `kindgi secrets set` in the env the runtime serves (it's read at the trigger's project, its org or the tenant, whichever you administer that has it), or the name --generate-secret stores it under. Never a model provider's key. Under `kindgi dev`, --generate-secret writes it to an env file, so the name is capital letters, digits and underscores, not starting with a digit (`ACME_WOO_ORDERS`). |
| `--signature-encoding <value>` | required with `--signature-header`                                                    | With --signature-header: `hex` or `base64`.                                                                                                                                                                                                                                                                                                                                                                                                           |
| `--signature-header <value>`   | none                                                                                  | Instead of --preset: the header that carries an HMAC-SHA256 of the raw body (with --signature-encoding).                                                                                                                                                                                                                                                                                                                                              |
| `--signature-prefix <value>`   | none                                                                                  | With --signature-header: stripped before decoding (e.g. `sha256=`).                                                                                                                                                                                                                                                                                                                                                                                   |

Every command also takes the [global flags](https://docs.kindgi.com/v0.1.9/reference/cli.md#global-flags).

**Examples**

From [Start runs from WooCommerce, Drupal or any signed webhook](https://docs.kindgi.com/v0.1.9/guides/webhooks/start-runs-from-webhooks.md):

```sh
pnpm exec kindgi webhooks register --flow=acme-shop.order-review --flow-version=0.1.0 \
```

**See also**

- [Start runs from WooCommerce, Drupal or any signed webhook](https://docs.kindgi.com/v0.1.9/guides/webhooks/start-runs-from-webhooks.md)
- [`kindgi webhooks`](https://docs.kindgi.com/v0.1.9/reference/cli/webhooks.md#kindgi-webhooks)

### `kindgi webhooks list`

**Synopsis**

```sh signature
kindgi webhooks list [--project=<project-id>] [--status=active|paused] [--limit=<n>] [--cursor=<c>]
```

List webhook triggers.

**Options**

| Option              | Default                       | Description                                                      |
| ------------------- | ----------------------------- | ---------------------------------------------------------------- |
| `--cursor <value>`  | none                          | Resume after this cursor, from the previous page's `nextCursor`. |
| `--limit <value>`   | `25` (at most `100`)          | The most to return (default 25, at most 100).                    |
| `--project <value>` | none                          | Only this project's webhook triggers.                            |
| `--status <value>`  | none (both active and paused) | Only `active` or only `paused` triggers.                         |

Every command also takes the [global flags](https://docs.kindgi.com/v0.1.9/reference/cli.md#global-flags).

**Examples**

List the webhook triggers in a project.

```sh
kindgi webhooks list --project=<project-id>
```

List only the paused triggers, as a table.

```sh
kindgi webhooks list --status=paused --table
```

**See also**

- [Start runs from WooCommerce, Drupal or any signed webhook](https://docs.kindgi.com/v0.1.9/guides/webhooks/start-runs-from-webhooks.md)
- [`kindgi webhooks`](https://docs.kindgi.com/v0.1.9/reference/cli/webhooks.md#kindgi-webhooks)

### `kindgi webhooks get`

**Synopsis**

```sh signature
kindgi webhooks get <trigger-id>
```

Fetch a webhook trigger, with its receive URL.

**Options**

Every command also takes the [global flags](https://docs.kindgi.com/v0.1.9/reference/cli.md#global-flags).

**Examples**

Show a trigger and the URL its sender posts to.

```sh
kindgi webhooks get <trigger-id>
```

**See also**

- [Start runs from WooCommerce, Drupal or any signed webhook](https://docs.kindgi.com/v0.1.9/guides/webhooks/start-runs-from-webhooks.md)
- [`kindgi webhooks`](https://docs.kindgi.com/v0.1.9/reference/cli/webhooks.md#kindgi-webhooks)

### `kindgi webhooks update`

**Synopsis**

```sh signature
kindgi webhooks update <trigger-id> [--flow-version=<v>] [--input=<json-or-@file>] [--secret=<name>] [--preset=woocommerce|drupal-webhooks|github|shopify|standard-webhooks | --signature-header=<h> --signature-encoding=hex|base64 [--signature-prefix=<p>]] [--delivery-id-header=<h>|none] [--body-limit=<bytes>] [--rate-limit=<per-minute>] [--label=<text>]
```

Change a webhook trigger: its flow version, input, secret, scheme, delivery-id header or limits. Its flow stays: register another trigger for another flow.

**Options**

| Option                         | Default                            | Description                                                                                                                                    |
| ------------------------------ | ---------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- |
| `--body-limit <value>`         | unchanged                          | The largest body it takes, in bytes (1024 to 1048576; default 262144).                                                                         |
| `--delivery-id-header <value>` | unchanged                          | The header whose value, with the body, dedupes deliveries (a preset sets it; `none` on update stops deduping).                                 |
| `--flow-version <value>`       | unchanged                          | Start this flow version instead.                                                                                                               |
| `--input <value>`              | unchanged                          | The flow's input on every delivery, as JSON or `@<file>`.                                                                                      |
| `--label <value>`              | unchanged                          | A short label.                                                                                                                                 |
| `--preset <value>`             | unchanged                          | How the sender signs, by sender: woocommerce\|drupal-webhooks\|github\|shopify\|standard-webhooks. Sets the scheme and the delivery-id header. |
| `--rate-limit <value>`         | unchanged                          | Accepted deliveries a minute (1 to 6000; default 600); past it, 429.                                                                           |
| `--secret <value>`             | unchanged                          | Verify with another secret, by name. To change a secret's value, use `kindgi secrets rotate`.                                                  |
| `--signature-encoding <value>` | required with `--signature-header` | With --signature-header: `hex` or `base64`.                                                                                                    |
| `--signature-header <value>`   | unchanged                          | Instead of --preset: the header that carries an HMAC-SHA256 of the raw body (with --signature-encoding).                                       |
| `--signature-prefix <value>`   | none                               | With --signature-header: stripped before decoding (e.g. `sha256=`).                                                                            |

Every command also takes the [global flags](https://docs.kindgi.com/v0.1.9/reference/cli.md#global-flags).

**Examples**

Point a trigger at a newer flow version.

```sh
kindgi webhooks update <trigger-id> --flow-version=0.2.0
```

Switch the sender's scheme to the GitHub preset and raise the rate limit.

```sh
kindgi webhooks update <trigger-id> --preset=github --rate-limit=1200
```

**See also**

- [Start runs from WooCommerce, Drupal or any signed webhook](https://docs.kindgi.com/v0.1.9/guides/webhooks/start-runs-from-webhooks.md)
- [`kindgi webhooks`](https://docs.kindgi.com/v0.1.9/reference/cli/webhooks.md#kindgi-webhooks)

### `kindgi webhooks pause`

**Synopsis**

```sh signature
kindgi webhooks pause <trigger-id>
```

Pause a webhook trigger. Deliveries are still taken (so the sender keeps the webhook on), recorded as skipped, and start nothing: their events are dropped, and WooCommerce never resends them.

**Options**

Every command also takes the [global flags](https://docs.kindgi.com/v0.1.9/reference/cli.md#global-flags).

**Examples**

Pause a trigger so deliveries start nothing.

```sh
kindgi webhooks pause <trigger-id>
```

**See also**

- [Start runs from WooCommerce, Drupal or any signed webhook](https://docs.kindgi.com/v0.1.9/guides/webhooks/start-runs-from-webhooks.md)
- [`kindgi webhooks`](https://docs.kindgi.com/v0.1.9/reference/cli/webhooks.md#kindgi-webhooks)

### `kindgi webhooks resume`

**Synopsis**

```sh signature
kindgi webhooks resume <trigger-id>
```

Resume a paused webhook trigger: deliveries start runs again.

**Options**

Every command also takes the [global flags](https://docs.kindgi.com/v0.1.9/reference/cli.md#global-flags).

**Examples**

Resume a paused trigger.

```sh
kindgi webhooks resume <trigger-id>
```

**See also**

- [Start runs from WooCommerce, Drupal or any signed webhook](https://docs.kindgi.com/v0.1.9/guides/webhooks/start-runs-from-webhooks.md)
- [`kindgi webhooks`](https://docs.kindgi.com/v0.1.9/reference/cli/webhooks.md#kindgi-webhooks)

### `kindgi webhooks fires`

**Synopsis**

```sh signature
kindgi webhooks fires <trigger-id> [--limit=<n>] [--cursor=<c>]
```

A webhook trigger's deliveries, newest first: the run each started, or why it was skipped (paused) or refused (a wrong or missing signature, a stale one, the limits, …). A fire keeps the event only until its run starts.

**Options**

| Option             | Default              | Description                                                      |
| ------------------ | -------------------- | ---------------------------------------------------------------- |
| `--cursor <value>` | none                 | Resume after this cursor, from the previous page's `nextCursor`. |
| `--limit <value>`  | `25` (at most `100`) | The most to return (default 25, at most 100).                    |

Every command also takes the [global flags](https://docs.kindgi.com/v0.1.9/reference/cli.md#global-flags).

**Examples**

From [Start runs from WooCommerce, Drupal or any signed webhook](https://docs.kindgi.com/v0.1.9/guides/webhooks/start-runs-from-webhooks.md):

```sh
pnpm exec kindgi webhooks fires <trigger-id> --table
```

**See also**

- [Start runs from WooCommerce, Drupal or any signed webhook](https://docs.kindgi.com/v0.1.9/guides/webhooks/start-runs-from-webhooks.md)
- [`kindgi webhooks`](https://docs.kindgi.com/v0.1.9/reference/cli/webhooks.md#kindgi-webhooks)

### `kindgi webhooks take-ownership`

**Synopsis**

```sh signature
kindgi webhooks take-ownership <trigger-id> [--run-as=<service-account-id>]
```

Become a webhook trigger's owner, so its runs act as you from the next delivery (for a trigger whose owner left). With --run-as, a service account becomes the owner instead.

**Options**

| Option             | Default                    | Description                                                                                                                                                                             |
| ------------------ | -------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `--run-as <value>` | none (you own the trigger) | A service account, by id: the trigger's owner, so its runs act as that account from the next delivery (not as you). Needs `act_as` on the account; omit it to own the trigger yourself. |

Every command also takes the [global flags](https://docs.kindgi.com/v0.1.9/reference/cli.md#global-flags).

**Examples**

Make its runs act as you.

```sh
kindgi webhooks take-ownership <trigger-id>
```

**See also**

- [Start runs from WooCommerce, Drupal or any signed webhook](https://docs.kindgi.com/v0.1.9/guides/webhooks/start-runs-from-webhooks.md)
- [`kindgi webhooks`](https://docs.kindgi.com/v0.1.9/reference/cli/webhooks.md#kindgi-webhooks)

### `kindgi webhooks unregister`

**Synopsis**

```sh signature
kindgi webhooks unregister <trigger-id>
```

Remove a webhook trigger: its sender is answered 410 from now on.

**Options**

Every command also takes the [global flags](https://docs.kindgi.com/v0.1.9/reference/cli.md#global-flags).

**Examples**

Remove a trigger; its sender gets 410 from then on.

```sh
kindgi webhooks unregister <trigger-id>
```

**See also**

- [Start runs from WooCommerce, Drupal or any signed webhook](https://docs.kindgi.com/v0.1.9/guides/webhooks/start-runs-from-webhooks.md)
- [`kindgi webhooks`](https://docs.kindgi.com/v0.1.9/reference/cli/webhooks.md#kindgi-webhooks)
