CLI & APICommand reference
stackblaze notifications
Slack, Discord and webhook notifications of your organization
Usage: stackblaze notifications|notification [options] [command]
Slack, Discord and webhook notifications of your organization
Options:
-h, --help Print help
Commands:
list|ls [options] List notifications (webhook URLs and secrets are
never shown without --reveal)
add [options] <name> Add a notification: where to post (--type, --url)
and which events (--event, repeatable)
enable [options] <ref> Switch a notification on (id or name)
disable [options] <ref> Switch a notification off without deleting it (id
or name)
remove|rm [options] <ref> Delete a notification (id or name)
events [options] List the event names a notification can subscribe
to
help [command] Print this message or the help of the given
subcommand(s)notifications list
Usage: stackblaze notifications list|ls [options]
List notifications (webhook URLs and secrets are never shown without --reveal)
Options:
--api-url <url> StackBlaze API base URL (env STACKBLAZE_API_URL)
--token <token> API token, sb_pat_... (env STACKBLAZE_TOKEN)
--json Output JSON (same as -o json) (default: false)
--reveal Include webhook URLs and secrets in --json output
(default: false)
-o, --output <format> Output format: text or json (choices: "text", "json")
-h, --help Print helpExample
List the organization's notifications. Webhook URLs and secrets stay hidden:
stackblaze notifications list┌──────────────┬─────────┬─────┬──────────────────┬──────────────────────┬───────────────────────────┐
│ Name │ Type │ On │ Projects │ Events │ Id │
├──────────────┼─────────┼─────┼──────────────────┼──────────────────────┼───────────────────────────┤
│ docs-deploys │ webhook │ no │ github-demo-cw8z │ deployApp, deleteApp │ cmww853ip006guz014j6zggnz │
└──────────────┴─────────┴─────┴──────────────────┴──────────────────────┴───────────────────────────┘
Webhook URLs and secrets are not shown; --reveal --json prints them.With --json (add --reveal to get the URL and secret too):
stackblaze notifications list --json[
{
"id": "cmww853ip006guz014j6zggnz",
"name": "docs-deploys",
"type": "webhook",
"enabled": false,
"pipelines": [
"github-demo-cw8z"
],
"events": [
"deployApp",
"deleteApp"
],
"config": {
"url": "********",
"secret": "********"
}
}
]notifications add
Usage: stackblaze notifications add [options] <name>
Add a notification: where to post (--type, --url) and which events (--event,
repeatable)
Options:
--api-url <url> StackBlaze API base URL (env STACKBLAZE_API_URL)
--token <token> API token, sb_pat_... (env STACKBLAZE_TOKEN)
--json Output JSON (same as -o json) (default: false)
--type <kind> slack, discord or webhook (choices: "slack",
"discord", "webhook")
--url <url> Incoming webhook URL (Slack / Discord) or your
endpoint (webhook)
--channel <name> Slack channel to post in
--secret <value> Webhook signing secret (webhook type)
--event <name> Event to send, repeatable (see `notifications events`)
--projects <name> Only events of this project, repeatable or
comma-separated (default: all projects)
--disabled Create it switched off (default: false)
--reveal Echo the URL/secret back in --json output (default:
false)
-o, --output <format> Output format: text or json (choices: "text", "json")
-h, --help Print help
Examples:
$ stackblaze notifications add deploys --type slack --url https://hooks.slack.com/services/… --channel '#deploys' --event deployApp --event rebuildApp
$ stackblaze notifications add audit --type webhook --url https://ops.example.com/hook --secret "$HOOK_SECRET" --event deleteApp --projects shop
$ stackblaze notifications eventsExample
Send a signed webhook to your own endpoint when an app in github-demo-cw8z is deployed or deleted. --disabled creates it switched off, so you can turn it on once the endpoint is ready:
stackblaze notifications add docs-deploys --type webhook \
--url https://example.com/hooks/stackblaze --secret "$HOOK_SECRET" \
--event deployApp --event deleteApp --projects github-demo-cw8z --disabledOK Added webhook notification docs-deploys (disabled)
projects: github-demo-cw8z events: deployApp, deleteApp
id: cmww853ip006guz014j6zggnznotifications enable
Usage: stackblaze notifications enable [options] <ref>
Switch a notification on (id or name)
Options:
--api-url <url> StackBlaze API base URL (env STACKBLAZE_API_URL)
--token <token> API token, sb_pat_... (env STACKBLAZE_TOKEN)
--json Output JSON (same as -o json) (default: false)
-o, --output <format> Output format: text or json (choices: "text", "json")
-h, --help Print helpExample
Switch a notification on by name (or ID):
stackblaze notifications enable docs-deploysOK Enabled notification docs-deploysnotifications disable
Usage: stackblaze notifications disable [options] <ref>
Switch a notification off without deleting it (id or name)
Options:
--api-url <url> StackBlaze API base URL (env STACKBLAZE_API_URL)
--token <token> API token, sb_pat_... (env STACKBLAZE_TOKEN)
--json Output JSON (same as -o json) (default: false)
-o, --output <format> Output format: text or json (choices: "text", "json")
-h, --help Print helpExample
Pause a notification without deleting it:
stackblaze notifications disable docs-deploysOK Disabled notification docs-deploysRunning it again changes nothing. --json says so with "changed": false:
stackblaze notifications disable docs-deploys --json{
"id": "cmww853ip006guz014j6zggnz",
"name": "docs-deploys",
"type": "webhook",
"enabled": false,
"pipelines": [
"github-demo-cw8z"
],
"events": [
"deployApp",
"deleteApp"
],
"config": {
"url": "********",
"secret": "********"
},
"changed": false
}notifications remove
Usage: stackblaze notifications remove|rm [options] <ref>
Delete a notification (id or name)
Options:
--api-url <url> StackBlaze API base URL (env STACKBLAZE_API_URL)
--token <token> API token, sb_pat_... (env STACKBLAZE_TOKEN)
--json Output JSON (same as -o json) (default: false)
-y, --yes Skip the confirmation prompt (default: false)
-o, --output <format> Output format: text or json (choices: "text", "json")
-h, --help Print helpExample
Delete a notification. Type yes to confirm (or pass -y):
stackblaze notifications remove docs-deploys! Deleting notification docs-deploys (webhook): its events stop being delivered.
Type "yes" to continue: yes
OK Removed notification docs-deploysnotifications events
Usage: stackblaze notifications events [options]
List the event names a notification can subscribe to
Options:
--json Output JSON (same as -o json) (default: false)
-o, --output <format> Output format: text or json (choices: "text", "json")
-h, --help Print helpExample
List the event names notifications add --event accepts:
stackblaze notifications eventsEvents a notification can subscribe to (--event, repeatable):
newPipeline
updatePipeline
deletePipeline
newApp
updateApp
deleteApp
restartApp
rebuildApp
deployApp
updateSettings
handleWebhookPush