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

# Get metric list API

Get every metric in your Drivetrain workspace, with the versions, dimensions and scenarios each one applies to, using a GET request.

Use this API to list every metric in your workspace and find the names you pass to [Get metrics bulk data API](https://integrations.drivetrain.ai/extending-drivetrain/drivetrain-api/get-metrics-bulk-data-api.md).

|             |                                                                                                                                                                                               |
| ----------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Method**  | `GET`                                                                                                                                                                                         |
| **URL**     | `https://{your_subdomain}.drivetrain.ai/drive/api/v1/public/metrics`                                                                                                                          |
| **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.                                                                                                                                                  |

This endpoint takes no parameters.

### Example request

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

### Example response (truncated)

```json
{
  "data": [
    {
      "name": "metrics.401Kpercent",
      "displayName": "401K %",
      "type": "PERCENTAGE",
      "domain": "PLANNING",
      "source": "FORMULA",
      "timeSummary": "AVG",
      "dimensionSummary": "SUM",
      "versions": [
        {
          "name": "Current",
          "displayName": "FY26 Operating Plan",
          "metricDisplayName": "401K %",
          "dimensions": ["emp_id", "department"],
          "scenarios": ["Base_Case", "Downside", "Upside"]
        },
        {
          "name": "Budget_2026",
          "displayName": "Budget 2026",
          "metricDisplayName": "401K %",
          "dimensions": ["emp_id", "department", "cost_center"],
          "scenarios": ["Base_Case"]
        }
      ]
    },
    {
      "name": "metrics.Expenses",
      "displayName": "Expenses",
      "type": "CURRENCY",
      "domain": "MONITORING",
      "source": "DATASET",
      "timeSummary": "SUM",
      "dimensionSummary": "SUM",
      "versions": [
        {
          "name": "Actual",
          "displayName": "Actual",
          "metricDisplayName": "Expenses",
          "dimensions": ["product", "region", "cost_center"],
          "scenarios": []
        }
      ]
    }
  ]
}
```

### Response fields

Each metric appears once, even when it exists in several versions. The order of `data` isn't guaranteed.

| Field              | Type           | Description                                                                                                                                                                                                                |
| ------------------ | -------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `name`             | string         | Backend name of the metric, including the `metrics.` prefix. Pass it in `metricNames` of [Get metrics bulk data API](https://integrations.drivetrain.ai/extending-drivetrain/drivetrain-api/get-metrics-bulk-data-api.md). |
| `displayName`      | string         | Name shown in the Drivetrain UI, taken from your live model when the metric exists there.                                                                                                                                  |
| `type`             | string or null | `NUMBER`, `CURRENCY` or `PERCENTAGE`, or `null` when not set.                                                                                                                                                              |
| `domain`           | string         | `PLANNING` for metrics added through your model's modules, `MONITORING` for metrics created in the Metric Builder.                                                                                                         |
| `source`           | string or null | `DATASET` (values come from a dataset), `FORMULA` (values come from a formula), or `null` when not set.                                                                                                                    |
| `timeSummary`      | string         | How values roll up over time, for example from months to a quarter.                                                                                                                                                        |
| `dimensionSummary` | string         | How values roll up across dimension values.                                                                                                                                                                                |
| `versions`         | array          | One entry per version the metric is defined in (see below). An entry doesn't mean the version holds data for the metric.                                                                                                   |

`timeSummary` and `dimensionSummary` use these values: `SUM`, `AVG`, `WEIGHTED_AVG`, `COUNT`, `COUNT_UNIQUE`, `UNIQUE`, `MIN`, `MAX`, `MEDIAN`, `END_OF_PERIOD`, `BEGINNING_OF_PERIOD`, `CUMULATIVE_SUM`, `CUMULATIVE_COUNT`, `FORMULA`, `CONSTANT` and `NONE`. The API returns the full words `END_OF_PERIOD` and `BEGINNING_OF_PERIOD`, not `EOP` and `BOP`.

**Fields inside each `versions[]` entry**

| Field               | Type             | Description                                                                                                                                                                                                                                                                                                                                                  |
| ------------------- | ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `name`              | string           | Version backend name. In your live model this is `Current` for `PLANNING` metrics and `Actual` for `MONITORING` metrics. In any other version it's the version's name, for example `Budget_2026`. Pass it in `versions` of [Get metrics bulk data API](https://integrations.drivetrain.ai/extending-drivetrain/drivetrain-api/get-metrics-bulk-data-api.md). |
| `displayName`       | string           | For `Current`, your model's name (`Current Plan` if the model has no name). For `Actual`, `Actual`. For other versions, `name` with underscores replaced by spaces.                                                                                                                                                                                          |
| `metricDisplayName` | string           | The metric's name in this version. It differs from the top-level `displayName` if the metric was renamed in this version.                                                                                                                                                                                                                                    |
| `dimensions`        | array of strings | Backend names of the dimensions the metric is cut by in this version. Empty when the metric isn't cut by any dimension. It can differ between versions of the same metric.                                                                                                                                                                                   |
| `scenarios`         | array of strings | Backend names of the scenarios set on the modules that contain the metric in this version. Always empty for `MONITORING` metrics.                                                                                                                                                                                                                            |

### Errors

| Status             | When                                                                        |
| ------------------ | --------------------------------------------------------------------------- |
| `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.                             |

A workspace with no metrics returns `200 OK` with `"data": []`.

### Before you request data

Check `versions[].dimensions` and `versions[].scenarios` before calling [Get metrics bulk data API](https://integrations.drivetrain.ai/extending-drivetrain/drivetrain-api/get-metrics-bulk-data-api.md). Dimensions that don't apply to a metric are ignored without an error (see [Things to check in your results](https://integrations.drivetrain.ai/extending-drivetrain/drivetrain-api/get-metrics-bulk-data-api.md#things-to-check-in-your-results)).


---

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