b2_delete_key
  • 11 Sep 2026
  • Dark
    Light

b2_delete_key

  • Dark
    Light

Article summary

Post
/b2api/v4/b2_delete_key

Deletes the application key specified


NOTE:

This API endpoint can be called using a GET request by converting the parameters in the request body to query parameters.


API Versions

v4 b2_delete_key (April 24, 2025)

Please note: only a Multi-Bucket Application Key will work with v4 b2_delete_key. If an earlier API version of b2_delete_key is called using a Multi-Bucket Application Key an error will be returned.


For information on all API versions, view our API changelog.

Header parameters
Authorization
stringRequired

An account authorization token, obtained from b2_authorize_account.

The token must have the deleteKeys capability.

Body parameters
object
applicationKeyId
string Required

The key to delete.

ExampleAPPLICATION_KEY_ID
Responses
200

The request succeeded.

object
keyName
string

The name assigned when the key was created.

Examplekey-0003
applicationKeyId
string

The ID of the newly created key.

Example00512f95cf4dcf0000000004z
capabilities
Array of string

A list of strings, each one naming a capability the key has.

Example[ "listKeys", "writeKeys", "deleteKeys" ]
string
Valid values[ "listKeys", "writeKeys", "deleteKeys", "listAllBucketNames", "listBuckets", "readBuckets", "writeBuckets", "deleteBuckets", "readBucketRetentions", "writeBucketRetentions", "readBucketEncryption", "writeBucketEncryption", "listFiles", "readFiles", "shareFiles", "writeFiles", "deleteFiles", "readFileLegalHolds", "writeFileLegalHolds", "readBucketNotifications", "readFileRetentions", "writeBucketNotifications", "writeFileRetentions", "bypassGovernance", "readBucketLogging", "writeBucketLogging" ]
accountId
string

The account that this application key is for.

ExampleACCOUNT_ID
expirationTimestamp
integer

When present, says when this key will expire, in milliseconds since 1970.

Example1671148244882
bucketIds
Array

When present, restricts access to the buckets in the array.

Example[ "ca1edec684c1f8805b570c17" ]
namePrefix
string

When present, restricts access to files whose names start with the prefix.

Examplefoo
options
Array of string

When present and set to s3, the key can be used to sign requests to the S3 Compatible API.

Example[ "s3" ]
string
Valid values[ "s3" ]
400
statuscodedescription
400bad_bucket_idThe requested bucket ID does not match an existing bucket.
400bad_requestThe request had the wrong fields or illegal values. The message returned with the error will describe the problem.
object
status
integer

The numeric HTTP status code. Always matches the status in the HTTP response.

Example400
code
string

A single-identifier code that identifies the error.

Exampleinvalid_bucket_name
message
string

A human-readable message, in English, saying what went wrong.

Examplebucket name is too long
401
statuscodedescription
401bad_auth_tokenThe auth token used is not valid. Call b2_authorize_account again to either get a new one, or an error message describing the problem.
401expired_auth_tokenThe auth token used has expired. Call b2_authorize_account again to get a new one.
401unauthorizedThe auth token used is valid, but does not authorize this call with these parameters. The capabilities of an auth token are determined by the application key used with b2_authorize_account.

Was this article helpful?