Get Bucket
client.r2.buckets.get(stringbucketName, BucketGetParams { account_id, jurisdiction } params, RequestOptionsoptions?): Bucket { creation_date, jurisdiction, location, 2 more }
GET/accounts/{account_id}/r2/buckets/{bucket_name}
Gets properties of an existing R2 bucket.
Security
API Token
The preferred authorization scheme for interacting with the Cloudflare API. Create a token.
Example:
Get Bucket
import Cloudflare from 'cloudflare';
const client = new Cloudflare({
apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted
});
const bucket = await client.r2.buckets.get('example-bucket', {
account_id: '023e105f4ecef8ad9ca31a8372d0c353',
});
console.log(bucket.creation_date);{
"errors": [
{
"code": 1000,
"message": "message",
"documentation_url": "documentation_url",
"source": {
"pointer": "pointer"
}
}
],
"messages": [
"string"
],
"result": {
"creation_date": "creation_date",
"jurisdiction": "default",
"location": "apac",
"name": "example-bucket",
"storage_class": "Standard"
},
"success": true
}Returns Examples
{
"errors": [
{
"code": 1000,
"message": "message",
"documentation_url": "documentation_url",
"source": {
"pointer": "pointer"
}
}
],
"messages": [
"string"
],
"result": {
"creation_date": "creation_date",
"jurisdiction": "default",
"location": "apac",
"name": "example-bucket",
"storage_class": "Standard"
},
"success": true
}