> For the complete documentation index, see [llms.txt](https://integrations.drivetrain.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://integrations.drivetrain.ai/extending-drivetrain/drivetrain-api/get-dimension-values-api.md).

# Get dimension values API

Get every value of one dimension, with its attributes, one page at a time, using a GET request.

Use this API to read the values of one dimension, with the attributes attached to each value, one page at a time.

|             |                                                                                                                                                                                               |
| ----------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Method**  | `GET`                                                                                                                                                                                         |
| **URL**     | `https://{your_subdomain}.drivetrain.ai/drive/api/v1/public/dimensions/{dimensionName}/values`                                                                                                |
| **Headers** | `apikey` (required). See [Authentication and API keys](https://github.com/DrivetrainAi/gitbook-integrations/tree/main/en/extending-drivetrain/drivetrain-api/authentication-and-api-keys.md). |
| **Role**    | The key's user must have the **Admin** role and full access to the dimension.                                                                                                                 |

### Parameters

| Name            | In    | Type    | Required | Default        | Description                                                                                                                                                                         |
| --------------- | ----- | ------- | -------- | -------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `dimensionName` | path  | string  | Yes      | —              | Backend name of the dimension, from [Get dimension list API](https://integrations.drivetrain.ai/extending-drivetrain/drivetrain-api/get-dimension-list-api.md). Not case-sensitive. |
| `attributes`    | query | string  | No       | All attributes | Comma-separated attribute names to return, for example `department,region`. Names are case-sensitive. Columns come back in the order you list them.                                 |
| `pageSize`      | query | integer | No       | `500`          | Rows per page, from `1` to `5000`.                                                                                                                                                  |
| `pageNumber`    | query | integer | No       | `1`            | Page to return, starting at `1`.                                                                                                                                                    |

### Example request

```bash
curl 'https://{your_subdomain}.drivetrain.ai/drive/api/v1/public/dimensions/emp_id/values?attributes=department,hire_date,is_active&pageSize=2' \
  --header 'apikey: {your_apikey}'
```

### Example response

```json
{
  "dimension": { "name": "emp_id", "displayName": "Employee ID", "type": "STRING" },
  "attributes": [
    { "name": "department", "displayName": "department", "type": "STRING" },
    { "name": "hire_date",  "displayName": "hire_date",  "type": "DATE" },
    { "name": "is_active",  "displayName": "is_active",  "type": "BOOL" }
  ],
  "data": [
    { "emp_id": "E001", "department": "Engineering", "hire_date": "2021-03-15", "is_active": true },
    { "emp_id": "E002", "department": "Sales",       "hire_date": null,         "is_active": false }
  ],
  "pageNumber": 1,
  "pageSize": 2,
  "hasMore": true
}
```

### Response fields

| Field        | Type             | Description                                                                                                                                                                  |
| ------------ | ---------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `dimension`  | object           | The dimension's `name`, `displayName` and `type`.                                                                                                                            |
| `attributes` | array of objects | The attribute columns returned in each row, in row order. Each has `name`, `displayName` (always the same as `name`) and `type`. Empty when the dimension has no attributes. |
| `data`       | array of objects | One object per dimension value (see below).                                                                                                                                  |
| `pageNumber` | integer          | The page you requested.                                                                                                                                                      |
| `pageSize`   | integer          | The page size you requested.                                                                                                                                                 |
| `hasMore`    | boolean          | `true` when another page follows.                                                                                                                                            |

**Each object in `data`**

| Key                                              | Description                                            |
| ------------------------------------------------ | ------------------------------------------------------ |
| The dimension's `name` (for example `emp_id`)    | The dimension value. Always the first key.             |
| Each attribute `name` (for example `department`) | The attribute value. `null` when the value is missing. |

Values are typed by the column's `type`:

| `type`                                        | JSON value                                            |
| --------------------------------------------- | ----------------------------------------------------- |
| `BOOL`                                        | `true` or `false`                                     |
| `INT64`, `FLOAT64`                            | number                                                |
| `NUMERIC`, `BIGNUMERIC`                       | string, so large financial values keep full precision |
| Any other type, including `DATE` and `STRING` | string                                                |

If a stored value can't be read as its type (for example `yes` in a `BOOL` column), it comes back as the original string.

### Errors

| Status             | When                                                                                                                                           | `message`                                                    |
| ------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------ |
| `400 Bad Request`  | `pageSize` is below `1` or above `5000`                                                                                                        | `pageSize must be between 1 and 5000`                        |
| `400 Bad Request`  | `pageNumber` is below `1`                                                                                                                      | `pageNumber must be >= 1`                                    |
| `400 Bad Request`  | `pageSize` or `pageNumber` isn't a whole number                                                                                                | `Invalid value for parameter 'pageSize'` (or `'pageNumber'`) |
| `400 Bad Request`  | A name in `attributes` isn't an attribute of the dimension                                                                                     | `Unknown attribute: <name>`                                  |
| `401 Unauthorized` | Missing or invalid `apikey`, or API access isn't part of your subscription                                                                     | —                                                            |
| `403 Forbidden`    | The key's user doesn't have the **Admin** role, or doesn't have full access to the dimension (for example, a dimension marked as confidential) | `You don't seem to have permission`                          |
| `404 Not Found`    | No dimension has that name                                                                                                                     | `Dimension not found: <dimensionName>`                       |

A dimension with no values returns `200 OK` with `"data": []` and the full `attributes` list.

### Paging

Rows come back in a stable order, so pages don't skip or repeat values while the dimension isn't changing. Start at `pageNumber=1` and keep adding 1 until `hasMore` is `false`. Access is all-or-nothing: you get every value of the dimension or a `403`, never a partial list.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://integrations.drivetrain.ai/extending-drivetrain/drivetrain-api/get-dimension-values-api.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
