# List Datasets

`GET /analytics` · Core · Analytics & Intelligence

Returns the project's active datasets, newest first: slug, display name, schema, partition keys (`region` is always the first), residency class, storage target and creation time. Requires the `datasets:list` permission (PROJECT_ADMIN, PROJECT_AUTHOR or PROJECT_EDITOR by default). Callers must be members of the project (an organization role alone does not grant access); project service tokens and extension tokens cannot call it.

## Parameters

| Name | In | Required | Description |
|---|---|---|---|
| `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 project's datasets, newest first. Retired datasets are left out. |
| `data.[]id` | string | yes | `dset_` id. |
| `data.[]slug` | string | yes | The dataset's name, unique in the project. Queries refer to it as `dataset.<slug>`. |
| `data.[]displayName` | string | yes | The name shown for the dataset. |
| `data.[]schema` | array of object | yes | The declared columns, in order. |
| `data.[]schema.[]name` | string | yes | The column's name. |
| `data.[]schema.[]type` | string | yes | `string`, `int32`, `int64`, `float64`, `bool`, `date`, `timestamp`, `json`, `bytes`, or `decimal(p,s)`. |
| `data.[]partitionKeys` | array of string | yes | Always starts with `region`, then the declared `partitionBy` keys. |
| `data.[]residencyClass` | enum ("per-subject", "shared") | yes | `per-subject`: rows hold data about individual people, sealed per person and kept in that person's region. `shared`: rows are not about any one person. |
| `data.[]storageTarget` | object | yes | Where the dataset's files are kept: `managed` for platform-managed storage, or `byos` with the `bindingId` of a storage location you connected. |
| _one of_ | | |  |
| `data.[]storageTarget.kind` | enum ("managed") | yes | Platform-managed storage. |
| _or_ | | |  |
| `data.[]storageTarget.kind` | enum ("byos") | yes | A storage location you connected. |
| `data.[]storageTarget.bindingId` | string | yes | The storage location's binding id. |
| `data.[]createdAt` | string (date-time) | yes | When the dataset was created. |
| `data.[]retiredAt` | null | yes | Always null: a retired dataset reads as absent. |
| `meta` | object | yes | Request metadata: cost, timing and correlation ids. |
| `meta.cost` | object | yes | Metered usage for this request; empty when nothing was metered. |
| `meta.timing` | object | yes |  |
| `meta.timing.gatewayMs` | number | yes |  |
| `meta.timing.totalMs` | number | yes |  |
| `meta.context` | object | yes |  |
| `meta.context.requestId` | string | yes |  |
| `meta.context.traceId` | string | yes |  |
| `meta.context.projectId` | string | no |  |
| `meta.warnings` | array of object | no |  |
| `meta.warnings.[]code` | string | yes |  |
| `meta.warnings.[]message` | string | yes |  |


## Errors

| HTTP | Code | When |
|---|---|---|
| 401 | `K9O_UNAUTHENTICATED` | The caller is not signed in. |
| 403 | `K9O_ACCESS_DENIED` | The caller is not a member of this project; an organization role alone does not grant access. |
| 404 | `K9O_NOT_FOUND` | The project was not found for this caller (project service tokens and extension tokens cannot call this endpoint). |
| 403 | `K9O_IAM_POLICY_DENIED` | The caller's role or IAM policy does not grant datasets:list. |

## Code samples

### cURL

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

### fetch

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

### k9o CLI

```bash
k9o analytics list
```

### @k9o/core

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

### k9o

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

### sdk-go

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

### k9o

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

### dev.k9o:core

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

### K9o.Core

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

### k9o

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

### k9o/sdk

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


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