/storage/buckets/{bucketName}/objectsList 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.
| bucketName * | path | The bucket's name. It is unique within the project. |
| prefix | query | 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. |
| HTTP | K9O Code | Description |
|---|---|---|
| 200 | Success | |
| 401 | K9O_UNAUTHENTICATED | Authentication is required. |
| 403 | K9O_RBAC_DENY | The caller's project role does not permit this object operation. |
| 403 | K9O_ACCESS_DENIED | The 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. |
| 404 | K9O_BUCKET_NOT_FOUND | No bucket with this name exists in the project. |
| data * | object[] | The objects in the bucket (under 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. |
// const k9o = new K9o({ orgSlug: 'playground', projectSlug: 'storefront', apiKey: 'k9o_…' })
const { data } = await k9o.from('<collection>').list()Showing example in TypeScript
{
"data": [
{
"path": "string",
"size": 0,
"lastModified": "string"
}
]
}