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

List Objects

Lists the objects in the bucket, optionally under a prefix.

Each entry has the object's path, its size in bytes and lastModified (an ISO 8601 time, or null when the store doesn't report one).

Needs list rights on the bucket; in a custom bucket the storage policy makes one decision for the whole request, never per object.

Parameters
bucketName *path

The bucket's name.

It is unique within the project.

prefixquery

List only objects whose path starts with this.

Omit it to list the whole bucket.

projectSlug *path

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

It is unique within the org.

Responses
HTTPK9O CodeDescription
200Success
401K9O_UNAUTHENTICATEDAuthentication is required.
403K9O_RBAC_DENYThe caller's project role does not permit this object operation.
403K9O_ACCESS_DENIEDThe bucket's storage policy does not allow list for this caller (context.reason storage_policy_denied). Checked after the role and IAM checks; a bucket with no policy is unaffected.
404K9O_BUCKET_NOT_FOUNDNo bucket with this name exists in the project.
Response body (200)
data *object[]

The objects in the bucket (under prefix when given).

The list is not paginated.

path *string

The object's path in the bucket.

size *integer

The object's size in bytes.

lastModified *any

When the object was last written, when the storage location reports it; null otherwise (objects on a customer storage location always read null).

One of: string <date-time>
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.from('<collection>').list()

Showing example in TypeScript

Response example (200)
{
  "data": [
    {
      "path": "string",
      "size": 0,
      "lastModified": "string"
    }
  ]
}

More in Storage & Schema