---
title: "Get Data from Dataset (v1)"
method: POST
path: "/api/v1/datasets/{datasetName}"
tags: ["Datasets", "Public API"]
deprecated: true
---

# Get Data from Dataset (v1)

`POST /api/v1/datasets/{datasetName}`

> **Deprecated.**

Deprecated. Use "Get Data from Dataset (v2)" instead.

Retrieves records from the specified dataset using the fields, filters, sorting, grouping, and aggregations supplied in the request body. Provide field names in the `fields` array; use "Get Fields from Dataset (v1.2)" to discover available names. The response contains paginated rows under `data`, an `aggregations` array (empty when none requested), and a `pagination` block with page navigation links. Results default to page 1 with 500 records per page (maximum 1000).

Use "Get Field Options (v1.2)" to retrieve valid filter values. Filter fields do not need to appear in the `fields` list. Future hires have a status of `Inactive`; include it in your status filter to retrieve them. For `options`-type fields using `includes`/`does_not_include`, pass the filter value as an array enclosed in square brackets, for example `["Full-Time", "Part-Time"]`.

When any requested fields are historical table fields, pass their entity names in `showHistory`; entity names are returned by "Get Fields from Dataset (v1.2)". Grouping (`groupBy`) currently supports only one field; when active, `data` becomes an object keyed by group value instead of an array. Sort priority follows the order of objects in `sortBy`. Aggregations accept a `defaultAggregation` applied to every field and/or per-field `overridingAggregations`.

**Aggregations by field type:** text: count; date: count, min, max; int: count, min, max, sum, avg; bool: count; options: count; govIdText: count.

**Filter operators by field type:** text: contains, does_not_contain, equal, not_equal, empty, not_empty; date: lt, lte, gt, gte (each accepts a YYYY-MM-DD date string or a relative object `{"duration": "N", "unit": "days|weeks|months|years"}` where duration is a number as a string — lt/lte are measured backward from today, gt/gte forward), equal, not_equal, empty, not_empty, last, next (relative object `{"duration": "N", "unit": "days|weeks|months|years"}`), range (object `{"start": "YYYY-MM-DD", "end": "YYYY-MM-DD"}`); int: equal, not_equal, gte, gt, lte, lt, empty, not_empty; bool: checked, not_checked; options: includes, does_not_include, empty, not_empty; govIdText: empty, not_empty.

OAuth Scopes: report

## Path parameters

- `datasetName` string, required

## Query parameters

- `page` integer
- `page_size` integer

## Request body

- DataRequest
  - `fields` string[], required — Field names to include in each returned record. Use "Get Fields from Dataset" to discover available names.
  - `aggregations` object — Aggregation configuration. Set `defaultAggregation` to apply one aggregation type to every requested field, or use `overridingAggregations` to target specific fields. Both may be combined.
    - `defaultAggregation` 'count' | 'count_unique' | 'sum' | 'avg' | 'min' | 'max', nullable — Aggregation type applied to all requested fields when set. Pass null to skip the default.
    - `overridingAggregations` object[] — Per-field aggregation overrides. Each element is an object whose single key is the field name and whose value is the aggregation type.
  - `sortBy` object[] — Ordered list of sort rules. Priority follows array order. Include aggregationType when sorting by an aggregated value in a grouped request; it must match an aggregation requested for the same field.
    - `field` string — Field name to sort by.
    - `sort` 'asc' | 'desc' — Sort direction.
    - `aggregationType` 'count' | 'count_unique' | 'sum' | 'avg' | 'min' | 'max' — Optional. Use when sorting by an aggregated value; must match the requested aggregation for this field.
  - `filters` object — Filter configuration. Combine multiple conditions with a `match` strategy.
    - `match` 'all' | 'any' — Logical operator for combining filters: `all` (AND) or `any` (OR).
    - `filters` object[] — Array of filter conditions. Filter fields do not need to appear in the top-level `fields` array.
      - `field` string — Field name to filter on.
      - `operator` 'contains' | 'does_not_contain' | 'equal' | 'not_equal' | 'empty' | 'not_empty' | 'lt' | 'lte' | 'gt' | 'gte' | 'last' | 'next' | 'range' | 'checked' | 'not_checked' | 'includes' | 'does_not_include' — Comparison operator. Available operators depend on field type (see endpoint description).
      - `value` unknown
  - `groupBy` string[] — Field names to group results by. Currently supports only one field. When grouping is active, the `data` key in the response becomes an object keyed by group value instead of an array.
  - `showHistory` string[] — Entity names of historical table fields whose history rows should be included. Entity names are returned by "Get Fields from Dataset".

## Response `200`

Returns an object with `data` (array of record objects, or an object keyed by group value when `groupBy` is used), `aggregations` (array, empty when none requested), and `pagination`.

- EmployeeResponse
  - `data` DatasetEmployee[]
  - `aggregations` object[]
    - `field` string
    - `aggregationType` string
    - `groups` object
    - `all` integer
  - `pagination` Pagination
    - `total_records` integer
    - `current_page` integer
    - `total_pages` integer
    - `next_page` string, nullable
    - `prev_page` string, nullable

## Other responses

- `400` — Invalid or missing argument(s), such as an unrecognised operator, malformed filter, invalid dataset name, or empty request body.
- `403` — Insufficient permissions to access this dataset.
- `500` — An unexpected internal error occurred while retrieving data.

---

[API](https://skmtc.net/bamboohr/apis/bamboohr-api.md) · [All operations](https://skmtc.net/bamboohr/apis/bamboohr-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/bamboohr/bamboohr-api/revisions/19ebf391a399/schema)
