bucket notification-rule create

Allows creating bucket notification rules for the given bucket.


Event Notifications feature is in “Private Preview” state and may change without notice. See https://www.backblaze.com/blog/announcing-event-notifications/ for details.


b2 notification-rule create b2://bucketName/optionalSubPath/ ruleName --event-type "b2:ObjectCreated:*" --webhook-url https://example.com/webhook

Requires capability:

  • readBucketNotifications

  • writeBucketNotifications

b2 bucket notification-rule create [-h] --event-type EVENT_TYPE --webhook-url
                                   WEBHOOK_URL [--sign-secret SIGN_SECRET]
                                   [--custom-header CUSTOM_HEADER] [--enable]
                                   [--disable] [--json]
                                   B2_URI ruleName

Positional Arguments


B2 URI of the bucket with optional path prefix, e.g. b2://bucketName or b2://bucketName/optionalSubPath/


Name of the rule

Named Arguments


Events scope, e.g., ‘b2:ObjectCreated:*’. Can be used multiple times to set multiple scopes.


URL to send the notification to


optional signature key consisting of 32 alphanumeric characters


Custom header to be sent with the notification. Can be used multiple times to set multiple headers. Format: HEADER_NAME=VALUE


Flag to enable the notification rule


Flag to disable the notification rule

Default: True


output in JSON format to use in scripts

Default: False