# List Collections

`GET /schema/collections` · Core · Storage & Schema

Returns a paginated list of all user-defined collections in the project, sourced from the project's `k9o_<proj_id>` schema. Each entry includes the collection name, approximate row count (from `pg_class.reltuples` — `rowCountIsExact: false`), column count, index count, and the slug and timestamp of the last migration that touched the collection. Requires `PROJECT_MEMBER` role minimum; uses cursor-based pagination with a default page size of 50.

## Parameters

| Name | In | Required | Description |
|---|---|---|---|
| `limit` | query | no | The most collections to return, 1 to 200. Default 50. A value outside the range is refused. |
| `cursor` | query | no | The `meta.cursor.next` of the previous page. Omit it for the first page. |
| `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 | One page of the project's collections, by name ascending. Pass `meta.cursor.next` as `cursor` for the next page. |
| `data.[]name` | string | yes | The collection (table) name. |
| `data.[]rowCount` | integer | yes | The live row count (soft-deleted rows excluded), counted without row-level security, so it can exceed what your own reads return. |
| `data.[]rowCountIsExact` | enum (true) | yes | Always true: `rowCount` is an exact count, not an estimate. |
| `data.[]columnCount` | integer | yes | How many columns the collection has, platform-reserved columns included. |
| `data.[]indexCount` | integer | yes | How many indexes the collection has, the primary key included. |
| `data.[]lastMigrationSlug` | object | yes | The slug of the most recent migration that touched the collection; null when none did (for example a collection created outside migrations). |
| _one of_ | | |  |
| _or_ | | |  |
| `data.[]lastMigrationAppliedAt` | object | yes | When that migration was applied; null when no migration touched the collection. |
| _one of_ | | |  |
| _or_ | | |  |
| `meta` | object | yes | Request metadata: cost, timing and correlation ids. The list adds `cursor` (`next`, `totalCount` null, `countMethod` `none`); both routes add a `K9O_ORG_CLAIM_UNBOUND` entry to `warnings` when the token has no org claim. |


## Errors

| HTTP | Code | When |
|---|---|---|
| 401 | `K9O_SESSION_EXPIRED` | Your session has expired; re-authenticate and retry. |
| 403 | `K9O_ACCESS_DENIED` | Your account does not have the required role (PROJECT_MEMBER or higher) to list schema collections for this project. |

## Code samples

### cURL

```bash
curl -X GET 'https://<org>.api-<region>.k9o.io/@storefront/schema/collections' \
  -H 'Authorization: Bearer $K9O_TOKEN'
```

### fetch

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

### k9o CLI

```bash
k9o schema collections
```

### @k9o/core

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

### k9o

```python
# k9o = create_client(org_slug="playground", project_slug="storefront", api_key="k9o_…")
response = k9o.schema.collections.list()
```

### sdk-go

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

### k9o

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

### dev.k9o:core

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

### K9o.Core

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

### k9o

```ruby
# k9o = K9o.create_client(org_slug: "playground", project_slug: "storefront", api_key: "k9o_…")
response = k9o.schema.collections.list()
```

### k9o/sdk

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


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