> 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-list-api.md).

# Get list API

Get the columns and rows of one Drivetrain list by its list ID, using a GET request.

Use this API to read the contents of one list: its names, its columns in order, and one object per row. To replace a list's rows, use [Upload list CSV API](https://github.com/DrivetrainAi/gitbook-integrations/tree/main/en/extending-drivetrain/drivetrain-api/upload-list-csv-api.md).

|             |                                                                                                                                                                                               |
| ----------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Method**  | `GET`                                                                                                                                                                                         |
| **URL**     | `https://{your_subdomain}.drivetrain.ai/drive/api/v1/public/lists/{listId}`                                                                                                                   |
| **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 access to the list.                                                                                                                           |

### Parameters

| Name     | In   | Type    | Required | Description            |
| -------- | ---- | ------- | -------- | ---------------------- |
| `listId` | path | integer | Yes      | The list's numeric ID. |

To find a list ID, open the list in Drivetrain. The ID is the number at the end of the URL. For `https://acme.drivetrain.ai/lists/5410000`, the list ID is `5410000`.

Each version keeps its own copy of a list, with its own ID. The API returns the stored rows of the copy that the ID belongs to, but calculates formula columns from your live model's lists. Only base-case rows are returned: rows changed or added in a scenario aren't included.

### Example request

```bash
curl 'https://{your_subdomain}.drivetrain.ai/drive/api/v1/public/lists/5410000' \
  --header 'apikey: {your_apikey}'
```

### Example response

```json
{
  "id": 5410000,
  "name": "Region",
  "displayName": "Region",
  "columns": ["Region", "Country", "Manager", "Headcount"],
  "rows": [
    { "Region": "EMEA",  "Country": "UK", "Manager": "Alice", "Headcount": "42" },
    { "Region": "NAMER", "Country": "US", "Manager": "Bob",   "Headcount": "118" },
    { "Region": "APAC",  "Country": "IN" }
  ]
}
```

### Response fields

| Field         | Type             | Description                                                                                    |
| ------------- | ---------------- | ---------------------------------------------------------------------------------------------- |
| `id`          | integer          | The list ID you requested.                                                                     |
| `name`        | string           | Backend name of the list.                                                                      |
| `displayName` | string           | Name shown in the Drivetrain UI. When none is set, `name` with underscores replaced by spaces. |
| `columns`     | array of strings | Column names, in the list's column order.                                                      |
| `rows`        | array of objects | One object per row you're allowed to see, in the list's row order. Keys are column names.      |

Every cell value is a string, including numbers, dates and formula results. Formula results that are very large or very small numbers can use exponent notation, such as `1.23456785E7`. A cell with no value can be missing from the row object entirely, as in the `APAC` row above, so treat a missing key or `null` as empty.

### Errors

| Status             | When                                                                               | `message`                              |
| ------------------ | ---------------------------------------------------------------------------------- | -------------------------------------- |
| `400 Bad Request`  | `listId` isn't a whole number                                                      | `Invalid value for parameter 'listId'` |
| `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 access to the list | `You don't seem to have permission`    |
| `404 Not Found`    | No active list has that ID                                                         | `Lists with id <listId> not found`     |

A list with no rows returns `200 OK` with the full `columns` array and `"rows": []`.


---

# 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-list-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.
