0

Get an Object Storage bucket

by
Published Oct 17, 2025

Returns a single Object Storage bucket. > 📘 > > You can use an outside API, such as the [Ceph Object Gateway S3 API](https://docs.ceph.com/en/latest/radosgw/s3/bucketops/#get-bucket) for more options. > --- - __OAuth scopes__. ``` object_storage:read_only ``` [Learn more...](https://techdocs.akamai.com/linode-api/reference/get-started#oauth)

Script linode Verified

The script

Submitted by hugo697 Bun
Verified 235 days ago
1
//native
2
type Linode = {
3
  token: string;
4
};
5
/**
6
 * Get an Object Storage bucket
7
 * Returns a single Object Storage bucket.
8

9
> 📘
10
>
11
> You can use an outside API, such as the [Ceph Object Gateway S3 API](https://docs.ceph.com/en/latest/radosgw/s3/bucketops/#get-bucket) for more options.
12

13

14
>
15

16
---
17

18

19
- __OAuth scopes__.
20

21
    ```
22
    object_storage:read_only
23
    ```
24

25
    [Learn more...](https://techdocs.akamai.com/linode-api/reference/get-started#oauth)
26
 */
27
export async function main(
28
  auth: Linode,
29
  apiVersion: "v4" | "v4beta",
30
  regionId: string,
31
  bucket: string,
32
) {
33
  const url = new URL(
34
    `https://api.linode.com/${apiVersion}/object-storage/buckets/${regionId}/${bucket}`,
35
  );
36

37
  const response = await fetch(url, {
38
    method: "GET",
39
    headers: {
40
      Authorization: "Bearer " + auth.token,
41
    },
42
    body: undefined,
43
  });
44
  if (!response.ok) {
45
    const text = await response.text();
46
    throw new Error(`${response.status} ${text}`);
47
  }
48
  return await response.json();
49
}
50