# kindgi webhooks

> Start flow runs from signed webhooks (WooCommerce, Drupal, GitHub, Shopify, Standard Webhooks): register, list, get, update, pause, resume, fires, versions, 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, versions, take-ownership, unregister.

**Commands**

| Command                                                                                                                     | Description                                                                                                                                                                                                                                                           |
| --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [`kindgi webhooks register`](https://docs.kindgi.com/v0.5.0/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.5.0/reference/cli/webhooks.md#kindgi-webhooks-list)                     | List webhook triggers.                                                                                                                                                                                                                                                |
| [`kindgi webhooks get`](https://docs.kindgi.com/v0.5.0/reference/cli/webhooks.md#kindgi-webhooks-get)                       | Fetch a webhook trigger as it is now, with its receive URL, or the version given.                                                                                                                                                                                     |
| [`kindgi webhooks update`](https://docs.kindgi.com/v0.5.0/reference/cli/webhooks.md#kindgi-webhooks-update)                 | Change a webhook trigger: its flow version, input, secret, scheme, delivery-id header, limits, label or the tools its runs may call unattended.                                                                                                                       |
| [`kindgi webhooks pause`](https://docs.kindgi.com/v0.5.0/reference/cli/webhooks.md#kindgi-webhooks-pause)                   | Pause a webhook trigger.                                                                                                                                                                                                                                              |
| [`kindgi webhooks resume`](https://docs.kindgi.com/v0.5.0/reference/cli/webhooks.md#kindgi-webhooks-resume)                 | Resume a paused webhook trigger: deliveries start runs again.                                                                                                                                                                                                         |
| [`kindgi webhooks fires`](https://docs.kindgi.com/v0.5.0/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 versions`](https://docs.kindgi.com/v0.5.0/reference/cli/webhooks.md#kindgi-webhooks-versions)             | List a webhook trigger's versions, newest first: when each was made, by whom, and why.                                                                                                                                                                                |
| [`kindgi webhooks take-ownership`](https://docs.kindgi.com/v0.5.0/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, or to make it shared (--run-as=project, the project's own account becomes the owner; --run-as=\<service-account-id>, that service account) or yours. |
| [`kindgi webhooks unregister`](https://docs.kindgi.com/v0.5.0/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.5.0/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>|project] [--allow-unattended=<tool-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. It's personal: its runs act as you, and only you or a project admin can change it. With `--run-as=project`, it's shared and acts as the project's own account; with `--run-as=<service-account-id>`, as that service account. Who it acts as is 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                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| ------------------------------ | ------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `--allow-unattended <value>`   | none (a tool that waits for a person still waits)                                     | A tool, by id, whose calls in this trigger's runs needn't wait for a person's yes, though the tool asks for one when no person started the run (repeatable; only tools its flow calls, no wildcard). Needs `admin` on the trigger's project. The workspace's and the agent's approval rules still apply. Repeatable.                                                                                                                                     |
| `--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 workspace's default project                                                       | The trigger's project, by id (default: the workspace'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, or `project`: the trigger's owner, so its runs act as that account from the next delivery (not as you). `project` runs it as the project's own account, made the first time, and takes `admin` on the project. The project's own account runs only what the project's editors can. A named account takes `act_as`, and needs a role that runs the flow (editor on its project). 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 workspace, 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.5.0/reference/cli.md#global-flags).

**Examples**

From [Start runs from WooCommerce, Drupal or any signed webhook](https://docs.kindgi.com/v0.5.0/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.5.0/guides/webhooks/start-runs-from-webhooks.md)
- [`kindgi webhooks`](https://docs.kindgi.com/v0.5.0/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.5.0/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.5.0/guides/webhooks/start-runs-from-webhooks.md)
- [`kindgi webhooks`](https://docs.kindgi.com/v0.5.0/reference/cli/webhooks.md#kindgi-webhooks)

### `kindgi webhooks get`

**Synopsis**

```sh signature
kindgi webhooks get <trigger-id> [<version>]
```

Fetch a webhook trigger as it is now, with its receive URL, or the version given.

**Options**

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

**Examples**

Show a trigger and the URL its sender posts to.

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

Fetch version 2 of a trigger: what it ran, and how it checked its sender.

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

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

```sh
pnpm exec kindgi webhooks get <trigger-id> <version>
```

**See also**

- [Start runs from WooCommerce, Drupal or any signed webhook](https://docs.kindgi.com/v0.5.0/guides/webhooks/start-runs-from-webhooks.md)
- [`kindgi webhooks`](https://docs.kindgi.com/v0.5.0/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>|--clear-label] [--allow-unattended=<tool-id>|none]…
```

Change a webhook trigger: its flow version, input, secret, scheme, delivery-id header, limits, label or the tools its runs may call unattended. Its flow stays: register another trigger for another flow.

**Options**

| Option                         | Default                            | Description                                                                                                                                                                                                                                                                                                                                                                           |
| ------------------------------ | ---------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `--allow-unattended <value>`   | unchanged                          | A tool, by id, whose calls in this trigger's runs needn't wait for a person's yes, though the tool asks for one when no person started the run (repeatable; only tools its flow calls, no wildcard). Needs `admin` on the trigger's project. The workspace's and the agent's approval rules still apply. Replaces the list; `none` clears it; left out, the list is kept. Repeatable. |
| `--body-limit <value>`         | unchanged                          | The largest body it takes, in bytes (1024 to 1048576; default 262144).                                                                                                                                                                                                                                                                                                                |
| `--clear-label`                | off                                | Take the label off.                                                                                                                                                                                                                                                                                                                                                                   |
| `--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 new short label (`--clear-label` takes it off).                                                                                                                                                                                                                                                                                                                                     |
| `--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.5.0/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.5.0/guides/webhooks/start-runs-from-webhooks.md)
- [`kindgi webhooks`](https://docs.kindgi.com/v0.5.0/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.5.0/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.5.0/guides/webhooks/start-runs-from-webhooks.md)
- [`kindgi webhooks`](https://docs.kindgi.com/v0.5.0/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.5.0/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.5.0/guides/webhooks/start-runs-from-webhooks.md)
- [`kindgi webhooks`](https://docs.kindgi.com/v0.5.0/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.5.0/reference/cli.md#global-flags).

**Examples**

From [Start runs from WooCommerce, Drupal or any signed webhook](https://docs.kindgi.com/v0.5.0/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.5.0/guides/webhooks/start-runs-from-webhooks.md)
- [`kindgi webhooks`](https://docs.kindgi.com/v0.5.0/reference/cli/webhooks.md#kindgi-webhooks)

### `kindgi webhooks versions`

**Synopsis**

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

List a webhook trigger's versions, newest first: when each was made, by whom, and why. `kindgi webhooks get <trigger-id> <version>` shows one.

**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.5.0/reference/cli.md#global-flags).

**Examples**

List a trigger's versions as a table: when each was made, by whom, and why.

```sh
kindgi webhooks versions <trigger-id> --table
```

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

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

**See also**

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

### `kindgi webhooks take-ownership`

**Synopsis**

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

Become a webhook trigger's owner, so its runs act as you from the next delivery: for a trigger whose owner left, or to make it shared (--run-as=project, the project's own account becomes the owner; --run-as=\<service-account-id>, that service account) or yours. Takes a project admin.

**Options**

| Option             | Default                    | Description                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| ------------------ | -------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `--run-as <value>` | none (you own the trigger) | A service account, by id, or `project`: the trigger's owner, so its runs act as that account from the next delivery (not as you). `project` runs it as the project's own account, made the first time, and takes `admin` on the project. The project's own account runs only what the project's editors can. A named account takes `act_as`, and needs a role that runs the flow (editor on its project). Omit it to own the trigger yourself. |

Every command also takes the [global flags](https://docs.kindgi.com/v0.5.0/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.5.0/guides/webhooks/start-runs-from-webhooks.md)
- [`kindgi webhooks`](https://docs.kindgi.com/v0.5.0/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.5.0/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.5.0/guides/webhooks/start-runs-from-webhooks.md)
- [`kindgi webhooks`](https://docs.kindgi.com/v0.5.0/reference/cli/webhooks.md#kindgi-webhooks)
