b2_update_bucket
Update an existing B2 bucket's type, CORS rules, lifecycle, encryption, Object Lock, and replication settings. Apply changes without recreating the bucket.
Instructions
Update the settings of an existing B2 bucket, including type, CORS rules, lifecycle rules, encryption, and replication configuration.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| confirm | No | Confirm a destructive change (making the bucket public, weakening Object Lock/lifecycle, or changing replication). Required when the server destructive policy is 'confirm' (the default); non-destructive updates do not need it. | |
| bucketId | Yes | The ID of the bucket to update. | |
| corsRules | No | CORS rules: <=100. allowedOrigins/allowedOperations require 1-100 non-empty strings; allowedHeaders/exposeHeaders allow <=100. Strings <=999 chars. Per-rule UTF-8 total <1,000. Names unique. | |
| bucketInfo | No | Custom metadata: <=10 pairs. Keys: 1-50 UTF-8 bytes, chars A-Z a-z 0-9 . _ ` ~ ! # $ % ^ & * ' | + -, no b2- prefix. Values total <=10,000 UTF-8 bytes. | |
| bucketType | No | ||
| ifRevisionIs | No | Conditional update — only update if the bucket revision matches this value. | |
| lifecycleRules | No | ||
| fileLockEnabled | No | Enable Object Lock on the bucket. Unlike S3's PutObjectLockConfiguration (which only enables lock at bucket creation), the B2 native API allows enabling Object Lock on an existing bucket here. Requires the writeBucketRetentions capability. | |
| defaultRetention | No | Default Object Lock retention for newly uploaded objects. Requires Object Lock enabled on the bucket. Send { mode: null, period: null } to clear. | |
| replicationConfiguration | No | ||
| defaultServerSideEncryption | No |