key create

Create a new application key.

Prints the application key information. This is the only time the application key itself will be returned. Listing application keys will show their IDs, but not the secret keys.

The capabilities are passed in as a comma-separated list, like readFiles,writeFiles. Optionally, you can pass all capabilities known to this client with --all-capabilities.

The duration is the length of time (in seconds) the new application key will exist. When the time expires the key will disappear and will no longer be usable. If not specified, the key will not expire.

The bucket is the name of a bucket in the account. When specified, the key will only allow access to that bucket.

The namePrefix restricts file access to files whose names start with the prefix.

The output is the new application key ID, followed by the application key itself. The two values returned are the two that you pass to account authorize to use the key.

Requires capability:

  • writeKeys

b2 key create [-h] [--bucket BUCKET] [--name-prefix NAME_PREFIX]
              [--duration DURATION] [--all-capabilities]
              keyName [capabilities]

Positional Arguments


Named Arguments


Default: False