---
title: Get metric
description: "Returns the full saved metric definition including type-specific params, version, and metadata."
product: general
lang: en
last_updated: 2026-10-06
token_estimate: 4117
---
# Get metric

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

## Get metric

**GET** `/v1/projects/{project_id}/metrics/{metric_id}`

Full URL: `https://developer-api.amplitude.com/v1/projects/{project_id}/metrics/{metric_id}`

**Servers:**
- Production (US): `https://developer-api.amplitude.com/v1/projects/{project_id}/metrics/{metric_id}`
- Production (EU): `https://developer-api.eu.amplitude.com/v1/projects/{project_id}/metrics/{metric_id}`

Get metric

Returns the full saved metric definition including type-specific params,
version, and metadata.

## Authorizations

| Name | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| Authorization | string | Yes | — | http |

## Path parameters

| Name | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| project_id (path) | string | Yes | 12345 | Amplitude project identifier, backed by the canonical app ID. Constraints: pattern: ^[0-9]+$ |
| metric_id (path) | string | Yes | — | Saved metric identifier. Constraints: min length: 1 |

## Response (application/json)

**200** — Successful response.

| Name | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| data | object | Yes | — | — |
| data.id | string | Yes | — | Stable metric identifier. |
| data.object | string | Yes | — | Resource-type discriminator. Always `metric`. |
| data.project_id | string | Yes | — | Constraints: pattern: ^[0-9]+$ |
| data.name | string | Yes | — | — |
| data.description | string | No | — | Constraints: nullable |
| data.metric_type | string | Yes | — | Public metric type discriminator (`snake_case`). See the `enum` for supported values. Unsupported or unrecognized metric types are surfaced as `unknown`. Clients should treat `unknown` as "a metric type this API version does not model yet". Allowed values: uniques, totals, formula, prop_sum, prop_avg, retention, conversion, unknown |
| data.definition | oneOf | Yes | — | Type-specific metric definition. The `metric_type` discriminator selects the required fields. Aligns with MCP `shared-schema` capabilities. Constraints: object, object, object, object, object, object, object, object |
| data.definition.metric_type | string | Yes | — | — |
| data.definition.event | object | No | — | — |
| data.definition.event.event_type | string | Yes | — | Event name (e.g. `Page View`, `_active`). |
| data.definition.event.filters | object[] | No | [] | — |
| data.definition.event.filters.property_key | string | Yes | — | Property key to filter on. |
| data.definition.event.filters.operator | string | Yes | — | Filter operator (matches Amplitude property operators). |
| data.definition.event.filters.values | string[] | No | [] | Values to match against. |
| data.definition.event.filters.property_type | string | No | — | Property namespace for filters, group-bys, and aggregations. Allowed values: event, user, group |
| data.definition.event.filters.group_type | string | No |  | Group type for group properties. Empty string for non-group. |
| data.definition.event.group_by | object[] | No | — | Properties to group by. Required for formula metrics that use property aggregation functions like `PROPSUM(A)` or `PROPAVG(A)`. |
| data.definition.event.group_by.property_type | string | Yes | — | Property namespace for filters, group-bys, and aggregations. Allowed values: event, user, group |
| data.definition.event.group_by.value | string | Yes | — | Property name to group by. |
| data.definition.event.group_by.group_type | string | No |  | Group type for group properties. Empty string for non-group. |
| data.definition.count_group | string | No | User | What to count. `User` for unique users, `Event` for event totals. |
| data.definition.events | object[] | No | — | Event definitions referenced by letter (A, B, C...) in the formula string. |
| data.definition.events.event_type | string | Yes | — | Event name (e.g. `Page View`, `_active`). |
| data.definition.events.filters | object[] | No | [] | — |
| data.definition.events.filters.property_key | string | Yes | — | Property key to filter on. |
| data.definition.events.filters.operator | string | Yes | — | Filter operator (matches Amplitude property operators). |
| data.definition.events.filters.values | string[] | No | [] | Values to match against. |
| data.definition.events.filters.property_type | string | No | — | Property namespace for filters, group-bys, and aggregations. Allowed values: event, user, group |
| data.definition.events.filters.group_type | string | No |  | Group type for group properties. Empty string for non-group. |
| data.definition.events.group_by | object[] | No | — | Properties to group by. Required for formula metrics that use property aggregation functions like `PROPSUM(A)` or `PROPAVG(A)`. |
| data.definition.events.group_by.property_type | string | Yes | — | Property namespace for filters, group-bys, and aggregations. Allowed values: event, user, group |
| data.definition.events.group_by.value | string | Yes | — | Property name to group by. |
| data.definition.events.group_by.group_type | string | No |  | Group type for group properties. Empty string for non-group. |
| data.definition.formula | string | No | — | Formula string. Reference events by letter. Functions include `UNIQUES(A)`, `TOTALS(A)`, `PROPSUM(A)`, `PROPAVG(A)`, `PROPMIN(A)`, `PROPMAX(A)`, `PROPCOUNT(A)`, `PROPCOUNTAVG(A)`, `REVENUETOTAL(A)`. |
| data.definition.aggregation_property | object | No | — | — |
| data.definition.aggregation_property.property_type | string | Yes | — | Property namespace for filters, group-bys, and aggregations. Allowed values: event, user, group |
| data.definition.aggregation_property.value | string | Yes | — | Numeric property name to aggregate. |
| data.definition.aggregation_property.group_type | string | No |  | — |
| data.definition.start_event | object | No | — | — |
| data.definition.start_event.event_type | string | Yes | — | Event name (e.g. `Page View`, `_active`). |
| data.definition.start_event.filters | object[] | No | [] | — |
| data.definition.start_event.filters.property_key | string | Yes | — | Property key to filter on. |
| data.definition.start_event.filters.operator | string | Yes | — | Filter operator (matches Amplitude property operators). |
| data.definition.start_event.filters.values | string[] | No | [] | Values to match against. |
| data.definition.start_event.filters.property_type | string | No | — | Property namespace for filters, group-bys, and aggregations. Allowed values: event, user, group |
| data.definition.start_event.filters.group_type | string | No |  | Group type for group properties. Empty string for non-group. |
| data.definition.start_event.group_by | object[] | No | — | Properties to group by. Required for formula metrics that use property aggregation functions like `PROPSUM(A)` or `PROPAVG(A)`. |
| data.definition.start_event.group_by.property_type | string | Yes | — | Property namespace for filters, group-bys, and aggregations. Allowed values: event, user, group |
| data.definition.start_event.group_by.value | string | Yes | — | Property name to group by. |
| data.definition.start_event.group_by.group_type | string | No |  | Group type for group properties. Empty string for non-group. |
| data.definition.return_event | object | No | — | — |
| data.definition.return_event.event_type | string | Yes | — | Event name (e.g. `Page View`, `_active`). |
| data.definition.return_event.filters | object[] | No | [] | — |
| data.definition.return_event.filters.property_key | string | Yes | — | Property key to filter on. |
| data.definition.return_event.filters.operator | string | Yes | — | Filter operator (matches Amplitude property operators). |
| data.definition.return_event.filters.values | string[] | No | [] | Values to match against. |
| data.definition.return_event.filters.property_type | string | No | — | Property namespace for filters, group-bys, and aggregations. Allowed values: event, user, group |
| data.definition.return_event.filters.group_type | string | No |  | Group type for group properties. Empty string for non-group. |
| data.definition.return_event.group_by | object[] | No | — | Properties to group by. Required for formula metrics that use property aggregation functions like `PROPSUM(A)` or `PROPAVG(A)`. |
| data.definition.return_event.group_by.property_type | string | Yes | — | Property namespace for filters, group-bys, and aggregations. Allowed values: event, user, group |
| data.definition.return_event.group_by.value | string | Yes | — | Property name to group by. |
| data.definition.return_event.group_by.group_type | string | No |  | Group type for group properties. Empty string for non-group. |
| data.definition.return_on | integer | No | — | Number of intervals to return on. Constraints: min: 1, max: 30 |
| data.definition.return_on_interval | integer | No | — | Interval length in days. `1` for daily, `7` for weekly, `30` for monthly. Constraints: min: 1, max: 30 |
| data.definition.funnel_events | object[] | No | — | Ordered funnel steps (minimum 2 events). |
| data.definition.funnel_events.event_type | string | Yes | — | Event name (e.g. `Page View`, `_active`). |
| data.definition.funnel_events.filters | object[] | No | [] | — |
| data.definition.funnel_events.filters.property_key | string | Yes | — | Property key to filter on. |
| data.definition.funnel_events.filters.operator | string | Yes | — | Filter operator (matches Amplitude property operators). |
| data.definition.funnel_events.filters.values | string[] | No | [] | Values to match against. |
| data.definition.funnel_events.filters.property_type | string | No | — | Property namespace for filters, group-bys, and aggregations. Allowed values: event, user, group |
| data.definition.funnel_events.filters.group_type | string | No |  | Group type for group properties. Empty string for non-group. |
| data.definition.funnel_events.group_by | object[] | No | — | Properties to group by. Required for formula metrics that use property aggregation functions like `PROPSUM(A)` or `PROPAVG(A)`. |
| data.definition.funnel_events.group_by.property_type | string | Yes | — | Property namespace for filters, group-bys, and aggregations. Allowed values: event, user, group |
| data.definition.funnel_events.group_by.value | string | Yes | — | Property name to group by. |
| data.definition.funnel_events.group_by.group_type | string | No |  | Group type for group properties. Empty string for non-group. |
| data.definition.funnel_mode | string | No | — | Allowed values: ordered, unordered, sequential |
| data.definition.conversion_seconds | integer | No | — | Maximum time window to complete the funnel, in seconds (e.g. `86400` = 1 day, `604800` = 7 days). Constraints: min: 1 |
| data.definition.funnel_paths_to_collect | string | No | — | Whether the funnel measures unique users completing the path or total conversion path counts. Allowed values: uniques, totals |
| data.definition.funnel_constant_properties | object[] | No | — | Properties held constant across funnel steps. |
| data.definition.funnel_constant_properties.property_type | string | Yes | — | Property namespace for filters, group-bys, and aggregations. Allowed values: event, user, group |
| data.definition.funnel_constant_properties.value | string | Yes | — | Numeric property name to aggregate. |
| data.definition.funnel_constant_properties.group_type | string | No |  | — |
| data.definition.funnel_compute_property | object | No | — | — |
| data.definition.funnel_compute_property.property_type | string | Yes | — | Property namespace for filters, group-bys, and aggregations. Allowed values: event, user, group |
| data.definition.funnel_compute_property.value | string | Yes | — | Numeric property name to aggregate. |
| data.definition.funnel_compute_property.group_type | string | No |  | — |
| data.definition.funnel_compute_property_function | string | No | — | Allowed values: sum, avg |
| data.version | integer | Yes | — | Optimistic concurrency version. Required on PATCH; incremented on each successful update. Constraints: min: 1 |
| data.created_at | string | Yes | — | Constraints: format: date-time, nullable |
| data.updated_at | string | Yes | — | Constraints: format: date-time, nullable |
| data.created_by | string | No | — | Creator email or login identifier when available. Constraints: nullable |
| data.url | string | Yes | — | Deep link to the metric in the Amplitude UI. Constraints: format: uri |
| data.archived | boolean | Yes | — | Whether the metric is archived (soft-deleted). |
| data.is_official | boolean | No | — | Whether the metric is marked official. |
| data.is_restricted | boolean | No | — | Whether the metric is restricted. |
| data.key_properties | object[] | No | — | Key properties associated with the metric definition. |
| data.key_properties.property_type | string | Yes | — | — |
| data.key_properties.value | string | Yes | — | — |
| data.key_properties.group_type | string | No | — | — |

```json
{
  "data": {
    "id": "string",
    "object": "metric",
    "project_id": "string",
    "name": "string",
    "description": "string",
    "metric_type": "uniques",
    "definition": {
      "metric_type": "uniques",
      "event": {
        "event_type": "string",
        "filters": [],
        "group_by": [
          {
            "property_type": "event",
            "value": "string",
            "group_type": ""
          }
        ]
      },
      "count_group": "User"
    },
    "version": 1,
    "created_at": "2024-01-01T00:00:00Z",
    "updated_at": "2024-01-01T00:00:00Z",
    "created_by": "string",
    "url": "https://example.com",
    "archived": true,
    "is_official": true,
    "is_restricted": true,
    "key_properties": [
      {
        "property_type": "string",
        "value": "string",
        "group_type": "string"
      }
    ]
  }
}
```

**400**

**401**

**403**

**404**

**429**

**500**

**503**

## Code samples

### cURL

```bash
curl -X GET "https://developer-api.amplitude.com/v1/projects/12345/metrics/{metric_id}" \
  -H "Content-Type: application/json" \
  -H "Authorization: YOUR_API_KEY"
```

### Python

```python
import requests

response = requests.get(
    "https://developer-api.amplitude.com/v1/projects/12345/metrics/{metric_id}",
    headers={
        "Content-Type": "application/json",
        "Authorization": "YOUR_API_KEY"
    }
)
data = response.json()
```

### JavaScript

```javascript
const response = await fetch("https://developer-api.amplitude.com/v1/projects/12345/metrics/{metric_id}", {
  method: "GET",
  headers: {
    "Content-Type": "application/json",
    "Authorization": "YOUR_API_KEY"
  }
});
const data = await response.json();
```

### PHP

```php
<?php
$ch = curl_init("https://developer-api.amplitude.com/v1/projects/12345/metrics/{metric_id}");
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "GET");
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    "Content-Type: application/json",
    "Authorization: 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://developer-api.amplitude.com/v1/projects/12345/metrics/{metric_id}", nil)
req.Header.Set("Content-Type", "application/json")
req.Header.Set("Authorization", "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://developer-api.amplitude.com/v1/projects/12345/metrics/{metric_id}"))
      .method("GET", HttpRequest.BodyPublishers.noBody())
.header("Content-Type", "application/json")
      .header("Authorization", "YOUR_API_KEY")
      .build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
```

### Ruby

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

uri = URI("https://developer-api.amplitude.com/v1/projects/12345/metrics/{metric_id}")
request = Net::HTTP::Get.new(uri)
request["Content-Type"] = "application/json"
request["Authorization"] = "YOUR_API_KEY"
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == "https") do |http|
  http.request(request)
end
```

