# inboxjot webhooks

Manage webhook endpoints and verify payloads.

## webhooks list

List webhook endpoints.

```sh
inboxjot webhooks list [options]
```

| Option                | Description                                 |
| --------------------- | ------------------------------------------- |
| `-n, --limit <LIMIT>` | Show at most this many rows. Default: `50`. |
| `--all`               | Show every row, one page after another.     |
| `--after <CURSOR>`    | Show the rows after this cursor.            |
| `--before <CURSOR>`   | Show the rows before this cursor.           |

```sh
inboxjot webhooks list
```

## webhooks inspect

Show a webhook endpoint and its recent deliveries.

```sh
inboxjot webhooks inspect <ENDPOINT>
```

| Argument   | Description                                     |
| ---------- | ----------------------------------------------- |
| `ENDPOINT` | Webhook endpoint ID, such as whk_123. Required. |

```sh
inboxjot webhooks inspect whk_123
```

## webhooks create

Create a webhook endpoint and print its signing secret.

```sh
inboxjot webhooks create [options]
```

| Option              | Description                                                                                                                                                                                                                                                                                                    |
| ------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `--url <URL>`       | HTTPS URL that receives the events.                                                                                                                                                                                                                                                                            |
| `--name <NAME>`     | Name of the endpoint; defaults to the URL host.                                                                                                                                                                                                                                                                |
| `--events <EVENTS>` | Comma-separated event types; defaults to every event. One of `email.sent`, `email.delivered`, `email.opened`, `email.clicked`, `email.bounced`, `email.complained`, `email.delivery_delayed`, `email.rejected`, `email.failed`, `email.unsubscribed`, `contact.created`, `contact.updated`, `contact.deleted`. |

```sh
inboxjot webhooks create --url https://acme.com/webhooks --events email.delivered,email.bounced
```

## webhooks update

Change a webhook endpoint.

```sh
inboxjot webhooks update <ENDPOINT> [options]
```

| Argument   | Description                                     |
| ---------- | ----------------------------------------------- |
| `ENDPOINT` | Webhook endpoint ID, such as whk_123. Required. |

| Option              | Description                                                                                                                                                                                                                                                                                                         |
| ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `--url <URL>`       | New HTTPS URL that receives the events.                                                                                                                                                                                                                                                                             |
| `--name <NAME>`     | New name of the endpoint.                                                                                                                                                                                                                                                                                           |
| `--events <EVENTS>` | Comma-separated event types that replace the current list. One of `email.sent`, `email.delivered`, `email.opened`, `email.clicked`, `email.bounced`, `email.complained`, `email.delivery_delayed`, `email.rejected`, `email.failed`, `email.unsubscribed`, `contact.created`, `contact.updated`, `contact.deleted`. |
| `--enable`          | Turn the endpoint on.                                                                                                                                                                                                                                                                                               |
| `--disable`         | Turn the endpoint off.                                                                                                                                                                                                                                                                                              |

```sh
inboxjot webhooks update whk_123 --disable
```

## webhooks delete

Delete a webhook endpoint.

```sh
inboxjot webhooks delete <ENDPOINT>
```

| Argument   | Description                                     |
| ---------- | ----------------------------------------------- |
| `ENDPOINT` | Webhook endpoint ID, such as whk_123. Required. |

```sh
inboxjot webhooks delete whk_123
```

## webhooks test

Send a test event to a webhook endpoint.

```sh
inboxjot webhooks test <ENDPOINT>
```

| Argument   | Description                                     |
| ---------- | ----------------------------------------------- |
| `ENDPOINT` | Webhook endpoint ID, such as whk_123. Required. |

```sh
inboxjot webhooks test whk_123
```

## webhooks secret show

Print the signing secret of a webhook endpoint.

```sh
inboxjot webhooks secret show <ENDPOINT>
```

| Argument   | Description                                     |
| ---------- | ----------------------------------------------- |
| `ENDPOINT` | Webhook endpoint ID, such as whk_123. Required. |

```sh
inboxjot webhooks secret show whk_123
```

## webhooks secret rotate

Replace the signing secret of a webhook endpoint.

```sh
inboxjot webhooks secret rotate <ENDPOINT>
```

| Argument   | Description                                     |
| ---------- | ----------------------------------------------- |
| `ENDPOINT` | Webhook endpoint ID, such as whk_123. Required. |

```sh
inboxjot webhooks secret rotate whk_123
```

## webhooks deliveries list

List webhook deliveries.

```sh
inboxjot webhooks deliveries list [options]
```

| Option                  | Description                                                                       |
| ----------------------- | --------------------------------------------------------------------------------- |
| `--endpoint <ENDPOINT>` | Show only deliveries to this endpoint.                                            |
| `--status <STATUS>`     | Show only deliveries with this outcome. One of `succeeded`, `retrying`, `failed`. |
| `-n, --limit <LIMIT>`   | Show at most this many rows. Default: `50`.                                       |
| `--all`                 | Show every row, one page after another.                                           |
| `--after <CURSOR>`      | Show the rows after this cursor.                                                  |
| `--before <CURSOR>`     | Show the rows before this cursor.                                                 |

```sh
inboxjot webhooks deliveries list --status failed
```

## webhooks deliveries inspect

Show the request and every attempt of a delivery.

```sh
inboxjot webhooks deliveries inspect <DELIVERY>
```

| Argument   | Description                             |
| ---------- | --------------------------------------- |
| `DELIVERY` | Delivery ID, such as whd_123. Required. |

```sh
inboxjot webhooks deliveries inspect whd_123
```

## webhooks deliveries replay

Send a delivery again.

```sh
inboxjot webhooks deliveries replay <DELIVERY>
```

| Argument   | Description                             |
| ---------- | --------------------------------------- |
| `DELIVERY` | Delivery ID, such as whd_123. Required. |

```sh
inboxjot webhooks deliveries replay whd_123
```

## webhooks verify

Check the signature of a webhook payload offline.

```sh
inboxjot webhooks verify [options]
```

| Option                     | Description                                                   |
| -------------------------- | ------------------------------------------------------------- |
| `--secret <SECRET>`        | Signing secret of the endpoint, starting with whsec\_.        |
| `--payload <FILE>`         | File with the raw request body, or - for stdin. Default: `-`. |
| `--id <ID>`                | Value of the webhook-id header.                               |
| `--timestamp <SECONDS>`    | Value of the webhook-timestamp header.                        |
| `--signature <SIGNATURES>` | Value of the webhook-signature header.                        |
| `-H, --header <HEADER>`    | Request header as 'Name: value'; repeat for each header.      |

```sh
inboxjot webhooks verify --secret "$WEBHOOK_SECRET" --payload body.json --id msg_123 --timestamp 1794220000 --signature "v1,K5oZ…"
```
