---
title: "Get metric"
method: GET
path: "/api/v2/metrics/{projectKey}/{metricKey}"
tags: ["Metrics"]
---

# Get metric

`GET /api/v2/metrics/{projectKey}/{metricKey}`

Get information for a single metric from the specific project.

### Expanding the metric response
LaunchDarkly supports four fields for expanding the "Get metric" response. By default, these fields are **not** included in the response.

To expand the response, append the `expand` query parameter and add a comma-separated list with any of the following fields:

- `experiments` includes all experiments from the specific project that use the metric
- `experimentCount` includes the number of experiments from the specific project that use the metric
- `metricGroups` includes all metric groups from the specific project that use the metric
- `metricGroupCount` includes the number of metric groups from the specific project that use the metric

For example, `expand=experiments` includes the `experiments` field in the response.

## Path parameters

- `projectKey` string, string, required — The project key
- `metricKey` string, string, required — The metric key

## Query parameters

- `expand` string, string — A comma-separated list of properties that can reveal additional information in the response. Supported fields are `experiments`, `experimentCount`, `metricGroups`, `metricGroupCount`, `eventSources`, `guardedRollouts`, `guardedRolloutCount`, `lastUsedInExperiment`, and `lastUsedInGuardedRollout`.
- `versionId` string, string — The specific version ID of the metric

## Response `200`

Metric response

- MetricRep
  - `experimentCount` integer — The number of experiments using this metric
  - `metricGroupCount` integer — The number of metric groups using this metric
  - `activeExperimentCount` integer — The number of active experiments using this metric
  - `activeGuardedRolloutCount` integer — The number of active guarded rollouts using this metric
  - `_id` string, required — The ID of this metric
  - `_versionId` string, required — The version ID of the metric
  - `_version` integer — Version of the metric
  - `key` string, required — A unique key to reference the metric
  - `name` string, required — A human-friendly name for the metric
  - `kind` 'pageview' | 'click' | 'custom', required — The kind of event the metric tracks
  - `_attachedFlagCount` integer — The number of feature flags currently attached to this metric
  - `_links` object, required — The location and content type of related resources
  - `_site` Link
    - `href` string
    - `type` string
  - `_access` Access
    - `denied` AccessDenied[], required
      - `action` string, required
      - `reason` AccessDeniedReason, required
        - `resources` string[] — Resource specifier strings
        - `notResources` string[] — Targeted resources are the resources NOT in this list. The <code>resources</code> and <code>notActions</code> fields must be empty to use this field.
        - `actions` ActionSpecifier[] — Actions to perform on a resource
        - `notActions` ActionSpecifier[] — Targeted actions are the actions NOT in this list. The <code>actions</code> and <code>notResources</code> fields must be empty to use this field.
        - `effect` 'allow' | 'deny', required — Whether this statement should allow or deny actions on the resources.
        - `role_name` string
    - `allowed` AccessAllowedRep[], required
      - `action` string, required
      - `reason` AccessAllowedReason, required
        - `resources` string[] — Resource specifier strings
        - `notResources` string[] — Targeted resources are the resources NOT in this list. The <code>resources</code> and <code>notActions</code> fields must be empty to use this field.
        - `actions` ActionSpecifier[] — Actions to perform on a resource
        - `notActions` ActionSpecifier[] — Targeted actions are the actions NOT in this list. The <code>actions</code> and <code>notResources</code> fields must be empty to use this field.
        - `effect` 'allow' | 'deny', required — Whether this statement should allow or deny actions on the resources.
        - `role_name` string
  - `tags` string[], required — Tags for the metric
  - `_creationDate` integer, required
  - `lastModified` Modification
    - `date` string, date-time
  - `maintainerId` string — The ID of the member who maintains this metric
  - `_maintainer` MemberSummary
    - `_links` object, required — The location and content type of related resources
    - `_id` string, required — The member's ID
    - `firstName` string — The member's first name
    - `lastName` string — The member's last name
    - `role` string, required — The member's base role. If the member has no additional roles, this role will be in effect.
    - `email` string, required — The member's email address
  - `description` string — Description of the metric
  - `category` string — The category of the metric
  - `isNumeric` boolean — For custom metrics, whether to track numeric changes in value against a baseline (<code>true</code>) or to track a conversion when an end user takes an action (<code>false</code>).
  - `successCriteria` 'HigherThanBaseline' | 'LowerThanBaseline' — For custom metrics, the success criteria
  - `unit` string — For numeric custom metrics, the unit of measure
  - `eventKey` string — For custom metrics, the event key to use in your code
  - `randomizationUnits` string[] — An array of randomization units allowed for this metric
  - `filters` Filter
    - `type` 'group' | 'contextAttribute' | 'eventProperty', required — Filter type. One of [contextAttribute, eventProperty, group]
    - `attribute` string — If not a group node, the context attribute name or event property name to filter on
    - `op` string, required
    - `values` unknown[], required — The context attribute / event property values or group member nodes
      - unknown
    - `contextKind` string — For context attribute filters, the context kind.
    - `negate` boolean, required — If set, then take the inverse of the operator. 'in' becomes 'not in'.
  - `unitAggregationType` 'average' | 'sum' — The method by which multiple unit event values are aggregated
  - `analysisType` 'mean' | 'percentile' — The method for analyzing metric events
  - `percentileValue` integer — The percentile for the analysis method. An integer denoting the target percentile between 0 and 100. Required when <code>analysisType</code> is <code>percentile</code>.
  - `eventDefault` MetricEventDefaultRep
    - `disabled` boolean — Whether to disable defaulting missing unit events when calculating results. Defaults to false
    - `value` number — The default value applied to missing unit events. Set to 0 when <code>disabled</code> is false. No other values are currently supported.
  - `dataSource` MetricDataSourceRefRep, required
    - `key` string, required
    - `environmentKey` string
    - `_name` string
    - `_integrationKey` string
  - `lastSeen` integer
  - `archived` boolean — Whether the metric version is archived
  - `archivedAt` integer
  - `selector` string — For click metrics, the CSS selectors
  - `urls` UrlMatcher[]
  - `experiments` DependentExperimentRep[]
    - `key` string, required — The experiment key
    - `name` string, required — The experiment name
    - `environmentId` string, required — The environment ID
    - `environmentKey` string, required — The environment key
    - `creationDate` integer, required
    - `archivedDate` integer
    - `_links` object, required — The location and content type of related resources
  - `metricGroups` DependentMetricGroupRep[] — Metric groups that use this metric
    - `key` string, required — A unique key to reference the metric group
    - `name` string, required — A human-friendly name for the metric group
    - `kind` 'funnel' | 'standard' | 'guardrail', required — The type of the metric group
    - `_links` object, required — The location and content type of related resources
  - `lastUsedInExperiment` DependentExperimentRep
    - `key` string, required — The experiment key
    - `name` string, required — The experiment name
    - `environmentId` string, required — The environment ID
    - `environmentKey` string, required — The environment key
    - `creationDate` integer, required
    - `archivedDate` integer
    - `_links` object, required — The location and content type of related resources
  - `lastUsedInGuardedRollout` DependentMeasuredRolloutRep
    - `_id` string, required — The guarded rollout measured rollout Id
    - `flagKey` string, required — The guarded rollout flag key
    - `flagName` string, required — The guarded rollout flag name
    - `flagPurpose` string — The guarded rollout flag purpose
    - `environmentKey` string, required — The guarded rollout environment key
    - `environmentName` string, required — The guarded rollout environment name
    - `status` string, required — The guarded rollout status
    - `creationDate` integer, required
    - `_links` object, required — The location and content type of related resources
  - `isActive` boolean — Whether the metric is active
  - `_attachedFeatures` FlagListingRep[] — Details on the flags attached to this metric
    - `name` string, required — The flag name
    - `key` string, required — The flag key
    - `_links` object
    - `_site` Link
      - `href` string
      - `type` string

## Other responses

- `401` — Invalid access token
- `403` — Forbidden
- `404` — Invalid resource identifier
- `429` — Rate limited

## Changes

- **2026-02-28** `69c5c9aafe78` — 8 info
  - added the optional property `activeExperimentCount` to the response with the `200` status
  - added the optional property `activeGuardedRolloutCount` to the response with the `200` status
  - added the optional property `archived` to the response with the `200` status
  - added the optional property `archivedAt` to the response with the `200` status
  - …4 more
- **2025-07-08** `b2724c5174d1` — 1 warning
  - added the new `guardrail` enum value to the `metricGroups/items/kind` response property for the response status `200`

[Change history](https://skmtc.dev/launchdarkly/apis/launchdarkly-rest-api/changes/api/v2/metrics/:projectKey/:metricKey/get.md)

---

[API](https://skmtc.dev/launchdarkly/apis/launchdarkly-rest-api.md) · [All operations](https://skmtc.dev/launchdarkly/apis/launchdarkly-rest-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/launchdarkly/launchdarkly-rest-api/revisions/69c5c9aafe78/schema)
