b2_create_bucket
Create a B2 cloud storage bucket, setting access type, CORS rules, lifecycle policies, encryption, and Object Lock.
Instructions
Create a new B2 bucket. Bucket names must be globally unique, 6-63 characters, and contain letters, digits, hyphens, and periods (names are not case-sensitive and cannot start with 'b2-').
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| 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. | |
| bucketName | Yes | The name for the new bucket. Must be globally unique. | |
| bucketType | Yes | allPublic allows unauthenticated downloads; allPrivate requires authorization. | |
| lifecycleRules | No | Lifecycle rules for automatic file management. | |
| fileLockEnabled | No | Enable Object Lock (file lock) on the bucket at creation. (Object Lock can also be enabled later on an existing bucket via b2_update_bucket.) Must be true before any retention or legal hold can be applied to files in this bucket. | |
| defaultServerSideEncryption | No | Default server-side encryption for new files in this bucket. |