---
title: List metric source
description: Reference for the GET /console/v1/metrics/metric_source/list API endpoint.
product: general
token_estimate: 2197
---
# List metric source

> For AI agents: a documentation index is available at [/llms.txt](/llms.txt). Append `.md` to any page URL for markdown, or send `Accept: text/markdown`.

## List metric source

**GET** `/console/v1/metrics/metric_source/list`

Full URL: `https://statsigapi.net/console/v1/metrics/metric_source/list`

List metric source

## Authorizations

| Name | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| STATSIG-API-KEY | string | Yes | — | apiKey (header) |

## Query parameters

| Name | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| limit (query) | integer | No | 10 | Results per page Constraints: string, number |
| page (query) | integer | No | 1 | Page number Constraints: string, number |

## Response (application/json)

**200** — List metric source response

| Name | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| message | string | Yes | — | A simple string explaining the result of the operation. |
| data | object[] | Yes | — | — |
| data.name | string | Yes | — | The name of the source, serving as its primary identifier. |
| data.description | string | Yes | — | A detailed description of the source, providing context and usage information. |
| data.tags | string[] | No | — | Optional tags for categorizing the source and improving searchability. |
| data.sql | string | Yes | — | The SQL query or statement used to extract data from the source. |
| data.timestampColumn | string | Yes | — | The name of the column containing timestamp data for the source. |
| data.timestampAsDay | boolean | No | — | Indicates whether the timestamp should be treated as a day-level granularity. |
| data.idTypeMapping | object[] | Yes | — | Array defining the mapping between Statsig unit IDs and their respective source columns. |
| data.idTypeMapping.statsigUnitID | string | Yes | — | The identifier mapping for Statsig units. |
| data.idTypeMapping.column | string | Yes | — | The corresponding column name in the source that relates to the Statsig unit ID. |
| data.sourceType | string | No | — | The type of source, indicating whether it is a database table or a custom query. Allowed values: table, query |
| data.tableName | string | No | — | The name of the database table if the source type is "table". |
| data.datePartitionColumn | string | No | — | The name of the date partition column if the source type is "table". Can be undefined. |
| data.customFieldMapping | object[] | No | — | Optional array defining mappings for custom fields using specific formulas. |
| data.customFieldMapping.key | string | Yes | — | The identifier for the custom field mapping. |
| data.customFieldMapping.formula | string | Yes | — | The formula or expression used to compute the custom field value. |
| data.isReadOnly | boolean | No | — | Specifies if the source can only be edited via the Console API. |
| data.isVerified | boolean | No | false | Marks the metric source as verified, indicating trustworthiness within the organization. |
| data.disableCURE | boolean | No | — | Disable CURE for all metrics built from this metric source |
| data.owner | object | No | {"ownerID":"user123","ownerType":"USER","ownerName":"John Doe","ownerEmail":"owner123@test.com"} | Schema for owner data including ID, type, name. Constraints: nullable |
| data.owner.ownerID | string | No | abc123 | ID of the owner |
| data.owner.ownerType | string | No | USER | Type of the owner (e.g., SDK_KEY or USER) |
| data.owner.ownerName | string | No | John Doe | The name of the owner. This field is optional. |
| data.owner.ownerEmail | string | No | — | The email of the owner. This field is optional. |
| data.team | string | No | — | Optional field indicating the team name responsible for the metric source, aiding in accountability and management. Constraints: nullable |
| data.teamID | string | No | — | Optional field indicating the team ID responsible for the metric source, aiding in accountability and management. Constraints: nullable |
| pagination | object | Yes | — | Pagination metadata for checking if there is next page for example. |
| pagination.itemsPerPage | number | Yes | — | Constraints: format: double |
| pagination.pageNumber | number | Yes | — | Constraints: format: double |
| pagination.nextPage | string | Yes | — | Constraints: nullable |
| pagination.previousPage | string | Yes | — | Constraints: nullable |
| pagination.totalItems | number | No | — | Constraints: format: double |
| pagination.all | string | No | — | — |

```json
{
  "message": "Metric sources listed successfully.",
  "data": [
    {
      "name": "Log Events",
      "description": "all app events including add to cart, purchase, page view, checkout",
      "tags": [],
      "sql": "SELECT *\nFROM shoppy-sales.logging.events\nwhere DATE(ts) between {statsig_start_date} and {statsig_end_date}\n",
      "timestampColumn": "ts",
      "timestampAsDay": false,
      "idTypeMapping": [
        {
          "statsigUnitID": "userID",
          "column": "user_id"
        },
        {
          "statsigUnitID": "deviceID",
          "column": "device_id"
        }
      ],
      "tableName": "",
      "customFieldMapping": [
        {
          "key": "",
          "formula": ""
        }
      ]
    }
  ],
  "pagination": {
    "itemsPerPage": 1,
    "pageNumber": 1,
    "totalItems": 14,
    "nextPage": "/console/v1/metrics/metric_source/list?page=2&limit=1",
    "previousPage": null,
    "all": "/console/v1/metrics/metric_source/list"
  }
}
```

**400** — Invalid request. Please check the request input and try again.

| Name | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| status | integer | Yes | — | Allowed values: 400 |
| message | string | Yes | — | — |

```json
{
  "status": 400,
  "message": "Invalid request. Please check the request input and try again."
}
```

**401** — This endpoint only accepts an active CONSOLE key, but an invalid key was sent. Key: console-xxxXXXxxxXXXxxx

| Name | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| status | integer | Yes | — | Allowed values: 401 |
| message | string | Yes | — | — |

```json
{
  "status": 401,
  "message": "This endpoint only accepts an active CONSOLE key, but an invalid key was sent. Key: console-xxxXXXxxxXXXxxx"
}
```

## Code samples

### cURL

```bash
curl -X GET "https://statsigapi.net/console/v1/metrics/metric_source/list?limit=10&page=1" \
  -H "Content-Type: application/json" \
  -H "STATSIG-API-KEY: YOUR_API_KEY"
```

### Python

```python
import requests

response = requests.get(
    "https://statsigapi.net/console/v1/metrics/metric_source/list?limit=10&page=1",
    headers={
        "Content-Type": "application/json",
        "STATSIG-API-KEY": "YOUR_API_KEY"
    }
)
data = response.json()
```

### JavaScript

```javascript
const response = await fetch("https://statsigapi.net/console/v1/metrics/metric_source/list?limit=10&page=1", {
  method: "GET",
  headers: {
    "Content-Type": "application/json",
    "STATSIG-API-KEY": "YOUR_API_KEY"
  }
});
const data = await response.json();
```

### PHP

```php
<?php
$ch = curl_init("https://statsigapi.net/console/v1/metrics/metric_source/list?limit=10&page=1");
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "GET");
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    "Content-Type: application/json",
    "STATSIG-API-KEY: YOUR_API_KEY"
]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
```

### Go

```go
package main

import (
  "bytes"
  "net/http"
)

func main() {
req, _ := http.NewRequest("GET", "https://statsigapi.net/console/v1/metrics/metric_source/list?limit=10&page=1", nil)
req.Header.Set("Content-Type", "application/json")
req.Header.Set("STATSIG-API-KEY", "YOUR_API_KEY")
  client := &http.Client{}
  resp, _ := client.Do(req)
  defer resp.Body.Close()
}
```

### Java

```java
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
      .uri(URI.create("https://statsigapi.net/console/v1/metrics/metric_source/list?limit=10&page=1"))
      .method("GET", HttpRequest.BodyPublishers.noBody())
.header("Content-Type", "application/json")
      .header("STATSIG-API-KEY", "YOUR_API_KEY")
      .build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
```

### Ruby

```ruby
require "net/http"
require "json"

uri = URI("https://statsigapi.net/console/v1/metrics/metric_source/list?limit=10&page=1")
request = Net::HTTP::Get.new(uri)
request["Content-Type"] = "application/json"
request["STATSIG-API-KEY"] = "YOUR_API_KEY"
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == "https") do |http|
  http.request(request)
end
```

