Webhooks
Command to interact with webhooks
The webhooks root command allows you to easily manage and test your environment webhooks.
stashbase webhooks <COMMAND> (-p <PROJECT> -e <ENVIRONMENT> | --scope=environment) [OPTIONS]List
Use this command to list all webhooks in the selected project and environment.
stashbase webhooks list [OPTIONS]Options
Prop
Type
Default sorting is by created_at in descending order. When sorting by url or enabled, results are secondarily sorted by created_at desc to keep ordering stable for ties.
Example
stashbase webhooks list -p my-projects -e public_api-dev
# sort by url ascending
stashbase webhooks list -p my-projects -e public_api-dev --sort-by url --sort asc
# example with scope=environment (environment-scoped API Key required)
stashbase webhooks list --scope=environmentGet
Use this command to single webhook from selected environment.
stashbase webhooks get <WEBHOOK_ID> [OPTIONS]Options
Prop
Type
Example
stashbase webhooks get whk_cU3p8L746dz3fR3oD48bzs -p project -e api-devCreate
Use this command to create new webhook in the selected environment.
stashbase webhooks create <URL> [OPTIONS]Options
Prop
Type
Examples
stashbase webhooks create https://my-api.com/webhook \
-p project -e api-dev
# With description and enable flag
stashbase webhooks create https://my-api.com/webhook --enable \
-d "My webhook description"
-p project -e api-devUpdate
Use this command to update existing webhook from selected environment.
stashbase webhooks update <WEBHOOK_ID> [OPTIONS]Options
Prop
Type
Example
stashbase webhooks update whk_cU3p8L746dz3fR3oD48bzs \
-u https://my-new-url.com
-p project -e api-dev
# Update description
stashbase webhooks update whk_cU3p8L746dz3fR3oD48bzs \
-d "My new webhook description"
-p project -e api-devEnable/Disable
Use this command to enable/disable webhook from selected environment.
stashbase webhooks enable/disable <WEBHOOK_ID> [OPTIONS]Options
Prop
Type
Examples
# Enable
stashbase webhooks enable wbk_cU3p8L746dz3fR3oD48bzs \
-p project -e api-dev
# Disable
stashbase webhooks disable wbk_cU3p8L746dz3fR3oD48bzs \
-p project -e api-devTest
With this command you can test webhook (send test event to webhook endpoint).
stashbase webhooks test <WEBHOOK_ID> [OPTIONS]Options
Prop
Type
Example
stashbase webhooks test whk_cU3p8L746dz3fR3oD48bzs \
-p project -e api-devRotate-secret
Use this command to rotate webhook's signing secret.
stashbase webhooks rotate-secret <WEBHOOK_ID> [OPTIONS]Options
Prop
Type
Example
stashbase webhooks rotate-secret whk_cU3p8L746dz3fR3oD48bzs \
-p project -e api-devDelete
Use this command to delete webhook in selected environment.
stashbase webhooks delete <WEBHOOK_ID> [OPTIONS]Options
Prop
Type
Example
stashbase webhooks delete whk_cU3p8L746dz3fR3oD48bzs \
-p project -e api-devList logs
Use this command to list webhook logs.
stashbase webhooks logs list <WEBHOOK_ID> [OPTIONS]Options
Prop
Type
Example
stashbase webhooks logs list whk_cU3p8L746dz3fR3oD48bzs \
--page 2 --page-size 10 \
-p project -e api-dev
# Format output as table
stashbase webhooks logs list whk_cU3p8L746dz3fR3oD48bzs \
-p project -e api-dev -f tableGet log
Use this command to get a single webhook log. This returns webhook log with response body data if available.
stashbase webhooks logs get <WEBHOOK_ID> <LOG_ID> [OPTIONS]Options
Prop
Type
Example
stashbase webhooks logs get whk_cU3p8L746dz3fR3oD48bzs whlog_cU3p8L746dz3fR3oD48bzs \
-p project -e api-devOpen
Use this command to open webhook details page in web dashboard.
stashbase webhooks open [WEBHOOK_ID] [OPTIONS]Options
This command does not accept any direct options.
Example
stashbase webhooks open whk_cU3p8L746dz3fR3oD48bzs \
-p project -e api-dev