Integrations CLI reference
The integrations command lets you manage a project’s notification
integrations, such as Slack, webhooks, email, and PagerDuty.
The commands use the
v3 Data API. --cli-input-json
and --output json use the v3 JSON documented there. For example, an
integration’s settings are in config.
All integrations commands need a project ID. Pass --project-id, or set a default with HONEYBADGER_PROJECT_ID or project_id in the configuration file.
List integrations
Section titled “List integrations”hb integrations list --project-id Xk9mZpRequired flags:
--project-id— Project ID. Required unless you set a default withHONEYBADGER_PROJECT_IDorproject_idin the configuration file.
Optional flags:
-o, --output— Output format:tableorjson(default:table)
Get integration details
Section titled “Get integration details”hb integrations get --project-id Xk9mZp --id Ch9wLpRequired flags:
--project-id— Project ID. Required unless you set a default withHONEYBADGER_PROJECT_IDorproject_idin the configuration file.--id— Integration ID
Optional flags:
-o, --output— Output format:textorjson(default:text)
Create an integration
Section titled “Create an integration”hb integrations create --project-id Xk9mZp --cli-input-json '{ "type": "WebHook", "config": { "url": "https://example.com/hook", "payload_version": "v3" }, "events": ["occurred", "resolved"]}'
# Or from a filehb integrations create --project-id Xk9mZp --cli-input-json file://integration.jsontype picks the integration, and config holds its settings. Each type has
its own config fields, listed in
Integration types.
OAuth integrations, such as Slack and GitHub, are created unconnected. Connect one in the web UI at the URL the command prints.
Required flags:
--project-id— Project ID. Required unless you set a default withHONEYBADGER_PROJECT_IDorproject_idin the configuration file.--cli-input-json— JSON payload (inline string orfile://path)
JSON fields:
type— Integration type, such asWebHook,Slack, orEmail(required)config— The type’s settingsevents— Events to notify on, such asoccurredandresolved(defaults to the type’s default events)active— Whether the integration sends notifications (default:true)
See the API reference for every field.
Optional flags:
-o, --output— Output format:textorjson(default:text)
Update an integration
Section titled “Update an integration”hb integrations update --project-id Xk9mZp --id Ch9wLp --cli-input-json '{"active": false}'Only the fields you send change. Sending null clears a field or
resets it to its default, but only on fields the API reference marks as
nullable. config is merged into the stored settings, so send only the
settings you’re changing. You can’t change an integration’s type. A successful update also clears
error, so an active integration that stopped after a failed delivery
starts delivering again.
Required flags:
--project-id— Project ID. Required unless you set a default withHONEYBADGER_PROJECT_IDorproject_idin the configuration file.--id— Integration ID--cli-input-json— JSON payload with fields to update
Delete an integration
Section titled “Delete an integration”hb integrations delete --project-id Xk9mZp --id Ch9wLpRequired flags:
--project-id— Project ID. Required unless you set a default withHONEYBADGER_PROJECT_IDorproject_idin the configuration file.--id— Integration ID