# List Objects

`GET /storage/buckets/{bucketName}/objects` · Core · Storage & Schema

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

| Name | In | Required | Description |
|---|---|---|---|
| `bucketName` | path | yes | The bucket's name. It is unique within the project. Example: `"product-images"`. |
| `prefix` | query | no | List only objects whose path starts with this. Omit it to list the whole bucket. |
| `projectSlug` | path | yes | The project's slug: the path segment after `@`. It is unique within the org. Example: `"storefront"`. |

## Responses

- **200**: Success

| Field | Type | Required | Description |
|---|---|---|---|
| `data` | array of object | yes | The objects in the bucket (under `prefix` when given). The list is not paginated. |
| `data.[]path` | string | yes | The object's path in the bucket. |
| `data.[]size` | integer | yes | The object's size in bytes. |
| `data.[]lastModified` | object | yes | 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_ | | |  |
| _or_ | | |  |
| `meta` | object | yes | Request metadata: cost, timing and correlation ids. |


## Errors

| HTTP | Code | When |
|---|---|---|
| 401 | `K9O_UNAUTHENTICATED` | Authentication is required. |
| 403 | `K9O_RBAC_DENY` | The caller's project role does not permit this object operation. |
| 404 | `K9O_BUCKET_NOT_FOUND` | No bucket with this name exists in the project. |
| 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. |

## Code samples

### cURL

```bash
curl -X GET 'https://<org>.api-<region>.k9o.io/@storefront/storage/buckets/product-images/objects' \
  -H 'Authorization: Bearer $K9O_TOKEN'
```

### fetch

```javascript
const res = await fetch('https://<org>.api-<region>.k9o.io/@storefront/storage/buckets/product-images/objects', {
  method: 'GET',
  headers: {
    'Authorization': `Bearer ${process.env.K9O_TOKEN}`
  },
});
const { data, meta } = await res.json();
```

### @k9o/core

```typescript
// const k9o = new K9o({ orgSlug: 'playground', projectSlug: 'storefront', apiKey: 'k9o_…' })
const { data } = await k9o.from('<collection>').list()
```

### k9o

```python
# k9o = create_client(org_slug="playground", project_slug="storefront", api_key="k9o_…")
response = k9o.from_("<collection>").list()
```

### sdk-go

```go
// ctx := context.Background()
// client, _ := k9o.NewClient(k9o.ClientOpts{OrgSlug: "playground", ProjectSlug: "storefront", APIKey: "k9o_…"})
data, _, kerr := client.From("<collection>").List()
```

### k9o

```rust
// let k9o = Client::new(ClientOpts { org_slug: "playground".into(), project_slug: "storefront".into(), api_key: "k9o_…".into() })?;
let resp = k9o.from("<collection>").list().await?
```

### dev.k9o:core

```java
// K9o k9o = K9o.createClient(K9o.Opts.builder().orgSlug("playground").projectSlug("storefront").apiKey("k9o_…").build());
var response = k9o.from("<collection>").list()
```

### K9o.Core

```c#
// var k9o = K9oClient.Create(new K9oOptions { OrgSlug = "playground", ProjectSlug = "storefront", ApiKey = "k9o_…" });
var response = await k9o.From("<collection>").ListAsync()
```

### k9o

```ruby
# k9o = K9o.create_client(org_slug: "playground", project_slug: "storefront", api_key: "k9o_…")
response = k9o.from("<collection>").list()
```

### k9o/sdk

```php
// $k9o = K9oClient::create(['org_slug' => 'playground', 'project_slug' => 'storefront', 'api_key' => 'k9o_…']);
$response = $k9o->from('<collection>')->list()
```

### K9o

```swift
// let k9o = try K9o.createClient(orgSlug: "playground", projectSlug: "storefront", apiKey: "k9o_…")
let result = try await k9o.from("<collection>").list()
```

### core-kotlin

```kotlin
// val k9o = createClient { orgSlug = "playground"; projectSlug = "storefront"; apiKey = "k9o_…" }
val result = k9o.from("<collection>").list()
```

### k9o (Flutter)

```dart
// final k9o = K9o.createClient(orgSlug: 'playground', projectSlug: 'storefront', apiKey: 'k9o_…');
final result = await k9o.from('<collection>').list()
```

### @k9o/react-native

```javascript
// const k9o = createClient({ orgSlug: 'playground', projectSlug: 'storefront', apiKey: 'k9o_…' })  // RN, secure storage
const { data } = await k9o.from('<collection>').list()
```


Canonical page: https://docs.kilimanjaro.dev/api-playground/core/list-objects
