Skip to main content
GET/storage/buckets/{bucketName}

Get Bucket

Returns one bucket, including its mode (private, public or custom).

Parameters
bucketName *path

The bucket's name.

It is unique within the project.

projectSlug *path

The project's slug: the path segment after @.

It is unique within the org.

Responses
HTTPK9O CodeDescription
200Success
403K9O_ACCESS_DENIEDThe caller does not have permission to read this storage bucket.
404K9O_BUCKET_NOT_FOUNDNo bucket with the specified name exists in this project.
Response body (200)
data *object

A storage bucket and its settings.

name *string

The bucket name, unique in the project.

mode *"private" | "public" | "custom"

Who can reach the bucket's objects. private: project roles and IAM policies only. public: as private, plus anyone may read (not list, write or delete) objects without signing in. custom: the bucket's storage policy decides; the bucket must already have one.

public *boolean

True when mode is public.

Derived from mode.

fileSizeLimit *any

The largest object an upload may write, in bytes; null when the bucket sets no limit.

One of: integer
or: null
allowedMimeTypes *string[]

MIME types an upload may have.

Empty means any type.

versioning *boolean

Whether earlier versions of an overwritten object are kept.

deleteAfterDays *any

Objects are deleted this many days after they were last uploaded: from that point they read as not found, and they are removed from the bucket within a few hours.

Null keeps them until deleted.

Only objects uploaded through the platform are deleted: one written straight into a customer storage location, or uploaded before per-object records began, is kept.

One of: integer
or: null
createdAt *string <date-time>

When the bucket was created.

updatedAt *string <date-time>

When the bucket's settings last changed.

system *boolean

True for a bucket the platform creates and writes (k9o-audit-anchors, k9o-extension-assets).

A system bucket can't be deleted, its objects can't be written or deleted through the API, and only its storage location can change.

byosBindingId *any

The storage location (byos_...) the bucket's objects are kept in; null for platform-managed storage.

One of: string
or: null
meta *any

Request metadata: cost, timing and correlation ids.

TypeScript
// const k9o = new K9o({ orgSlug: 'playground', projectSlug: 'storefront', apiKey: 'k9o_…' })
const { data } = await k9o.storage.getBucket('product-images')

Showing example in TypeScript

Response example (200)
{
  "data": {
    "name": "string",
    "mode": "private",
    "public": false,
    "fileSizeLimit": 0,
    "allowedMimeTypes": [
      "string"
    ],
    "versioning": false,
    "deleteAfterDays": 0,
    "createdAt": "string",
    "updatedAt": "string",
    "system": false,
    "byosBindingId": "string"
  }
}

More in Storage & Schema