# Read Rollup

`GET /rollups/{rollupSlug}/read` · Core · Analytics & Intelligence

Returns the rollup's cells for a time range. Query: `from` and `to` (ISO 8601; default the last 24 hours, at most 50,000 cells) and `dims` (a comma-separated projection; only `count`, `sum`, `min` and `max` measures combine). Cells below the cohort threshold come back as `{status: "suppressed", reason: "cohort_below_k"}`; `coverage` reports the range, the last fold and whether it is complete.

Requires `datasets:read` on the rollup's dataset and `datasets:query`.

Callers must be members of the project (an organization role alone does not grant access); project service tokens and extension tokens cannot call it.

Returns `503 K9O_ANALYTICS_UNAVAILABLE` until the region's analytics storage is provisioned.

## Parameters

| Name | In | Required | Description |
|---|---|---|---|
| `rollupSlug` | path | yes | The rollup's slug: 1 to 63 lowercase letters, digits and hyphens. Example: `"orders-by-country"`. |
| `from` | query | no | The start of the range, an ISO 8601 instant (inclusive, compared with each cell's window start). Default 24 hours before `to`. Must be before `to`. Example: `"2026-11-14T00:00:00.000Z"`. |
| `to` | query | no | The end of the range, an ISO 8601 instant (exclusive). Default: the time of the request. A range holding more than 50,000 cells is refused. Example: `"2026-11-15T00:00:00.000Z"`. |
| `dims` | query | no | A comma-separated subset of the rollup's dimensions to group the cells by; empty groups by window alone. Omit it for every declared dimension. A projection onto fewer dimensions works only when every measure is `count`, `sum`, `min` or `max`. Example: `"country"`. |
| `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` | object | yes | The rollup's cells over the requested range. |
| `data.rollup` | object | yes | The rollup that was read. |
| `data.rollup.slug` | string | yes | The rollup's slug. |
| `data.rollup.windowSeconds` | integer | yes | The length of each window, in seconds. |
| `data.rollup.dimensions` | array of string | yes | The declared dimensions. |
| `data.rollup.measures` | array of object | yes | The declared measures. |
| `data.rollup.measures.[]name` | string | yes | The measure's name: its key in each cell's `measures`. |
| `data.rollup.measures.[]agg` | string | yes | `count`, `last`, `sum`, `avg`, `min`, `max`, `count_distinct`, `p50`, `p95` or `p99`. |
| `data.rollup.measures.[]column` | string | no | The source field aggregated. Absent for `count`. |
| `data.k` | integer | yes | The k-anonymity threshold a per-subject cell must meet. |
| `data.cells` | array of object | yes | The cells in the range, oldest window first. A suppressed cell carries `status` and `reason` instead of `measures`. |
| _one of_ | | |  |
| `data.cells.[]bucket` | string (date-time) | yes | The window start. |
| `data.cells.[]dims` | object | yes | The cell's dimension values, one key per dimension: every declared dimension, or only those named in `?dims=` when the read projects. Each value is the stored value of that dimension column as the dataset query returns it, or null when the cell has none. |
| `data.cells.[]measures` | object | yes | The cell's measure values, one key per declared measure name. A `count`, `sum`, `avg`, `min`, `max`, `count_distinct` or percentile measure is a number, or null when the cell has no value. A `last` measure is the stored value as the dataset query returns it, or null. Absent on a suppressed cell. |
| _or_ | | |  |
| `data.cells.[]bucket` | string (date-time) | yes | The window start. |
| `data.cells.[]dims` | object | yes | The cell's dimension values, one key per dimension: every declared dimension, or only those named in `?dims=` when the read projects. Each value is the stored value of that dimension column as the dataset query returns it, or null when the cell has none. |
| `data.cells.[]status` | enum ("suppressed") | yes | The cell is withheld: too few people are in it. |
| `data.cells.[]reason` | enum ("cohort_below_k") | yes | Always `cohort_below_k`: the cell's cohort is smaller than `k`. |
| `data.coverage` | object | yes | What the answer covers. |
| `data.coverage.from` | string (date-time) | yes | The start of the range that was read. |
| `data.coverage.to` | string (date-time) | yes | The end of the range that was read (exclusive). |
| `data.coverage.lastFoldAt` | object | yes | When the rollup last folded new events into cells. Null when it never has. |
| _one of_ | | |  |
| _or_ | | |  |
| `data.coverage.complete` | boolean | yes | True when the last fold succeeded and covered the whole range, so no cell in it is still to change. |
| `data.coverage.excludedSuppressedCells` | integer | yes | How many suppressed cells a `dims` projection left out: a withheld cell can't be combined into a coarser one. Always 0 without a projection. |
| `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. |
| 403 | `K9O_IAM_POLICY_DENIED` | The caller's role or IAM policy does not grant datasets:read. |
| 400 | `K9O_INVALID_FIELD_VALUE` | `from`/`to` are invalid or the range exceeds 50,000 cells, or `dims` is invalid or projects a measure that cannot be combined. |
| 404 | `K9O_NOT_FOUND` | No rollup with this slug exists in the project. |
| 404 | `K9O_DATASET_NOT_FOUND` | No active dataset with this slug exists in the project. |
| 409 | `K9O_STATE_CONFLICT` | The rollup's per-subject data cannot be served: a subject declaration or the cohort marker is missing. |
| 500 | `K9O_QUERY_EXECUTION_FAILED` | The query failed while running. |
| 503 | `K9O_ANALYTICS_UNAVAILABLE` | The region's analytics storage is not available yet; retry later. |

## Code samples

### cURL

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

### fetch

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

### k9o CLI

```bash
k9o rollups read <slug>
```

### @k9o/core

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

### k9o

```python
# k9o = create_client(org_slug="playground", project_slug="storefront", api_key="k9o_…")
response = k9o.rollups.read("<rollupSlug>")
```

### sdk-go

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

### k9o

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

### dev.k9o:core

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

### K9o.Core

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

### k9o

```ruby
# k9o = K9o.create_client(org_slug: "playground", project_slug: "storefront", api_key: "k9o_…")
response = k9o.rollups.read("<rollupSlug>")
```

### k9o/sdk

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


Canonical page: https://docs.kilimanjaro.dev/api-playground/core/read-rollup
