For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Sign inTry it free
DocsGuidesSDKsIntegrationsAPI docsTutorialsFlagship blog
DocsGuidesSDKsIntegrationsAPI docsTutorialsFlagship blog
  • REST API overview
    • Access Tokens
    • Account Members
    • Account Usage Beta
    • AI Configs
    • Announcements
    • Applications Beta
    • Approvals
    • Approvals Beta
    • Audit Log
    • Code References
    • Contexts
    • Context Settings
    • Custom Roles
    • Data Export Destinations
    • Environments
    • Experiments
    • Feature Flags
    • Feature Flags Beta
    • Flag Import Configurations Beta
    • Flag Links Beta
    • Flag Triggers
    • Follow Flags
    • Holdouts Beta
    • Insights Charts Beta
    • Insights Deployments Beta
    • Insights Flag Events Beta
    • Insights Pull Requests Beta
    • Insights Repositories Beta
    • Insights Scores Beta
    • Integration Audit Log Subscriptions
    • Integration Delivery Configurations Beta
    • Integrations Beta
    • Layers
    • Metrics
    • Metrics Beta
      • POSTCreate metric group
      • DELDelete metric group
      • GETGet metric group
      • GETList metric groups
      • PATCHPatch metric group
    • OAuth2 Clients
    • Persistent Store Integrations Beta
    • Projects
    • Relay Proxy Configurations
    • Release Pipelines Beta
    • Releases Beta
    • Scheduled Changes
    • Segments
    • Tags
    • Teams
    • Teams Beta
    • Users
    • Users Beta
    • User Settings
    • Views Beta
    • Webhooks
    • Workflows
    • Workflow Templates
    • Other
Sign inTry it free
LogoLogo
REST API overviewMetrics Beta

List metric groups

GET
/api/v2/projects/:projectKey/metric-groups
GET
/api/v2/projects/:projectKey/metric-groups
$curl https://app.launchdarkly.com/api/v2/projects/projectKey/metric-groups \
> -H "Authorization: <apiKey>"
1{
2 "items": [
3 {
4 "_id": "bc3e5be1-02d2-40c7-9926-26d0aacd7aab",
5 "key": "metric-group-key-123abc",
6 "name": "My metric group",
7 "kind": "funnel",
8 "_links": {
9 "parent": {
10 "href": "/api/v2/projects/my-project",
11 "type": "application/json"
12 },
13 "self": {
14 "href": "/api/v2/projects/my-project/metric-groups/my-metric-group",
15 "type": "application/json"
16 }
17 },
18 "tags": [
19 "ops"
20 ],
21 "_creationDate": 1628192791148,
22 "_lastModified": 1628192791148,
23 "maintainer": {
24 "key": "569fdeadbeef1644facecafe",
25 "kind": "member",
26 "_member": {
27 "_links": {
28 "self": {
29 "href": "/api/v2/members/569f183514f4432160000007",
30 "type": "application/json"
31 }
32 },
33 "_id": "569f183514f4432160000007",
34 "role": "admin",
35 "email": "ariel@acme.com",
36 "firstName": "Ariel",
37 "lastName": "Flores"
38 },
39 "_team": {
40 "customRoleKeys": [
41 "access-to-test-projects"
42 ],
43 "key": "team-key-123abc",
44 "name": "QA Team",
45 "_links": {}
46 }
47 },
48 "metrics": [
49 {
50 "key": "metric-key-123abc",
51 "name": "Example metric",
52 "kind": "custom",
53 "_links": {
54 "self": {
55 "href": "/api/v2/metrics/my-project/my-metric",
56 "type": "application/json"
57 }
58 },
59 "_versionId": "version-id-123abc",
60 "isNumeric": true,
61 "unitAggregationType": "sum",
62 "eventKey": "event-key-123abc",
63 "nameInGroup": "Step 1",
64 "analysisUnits": [
65 "user"
66 ],
67 "randomizationUnits": [
68 "user"
69 ]
70 }
71 ],
72 "_version": 1,
73 "description": "Description of the metric group",
74 "_access": {
75 "denied": [
76 {
77 "action": "string",
78 "reason": {
79 "effect": "allow",
80 "resources": [
81 "proj/*:env/*;qa_*:/flag/*"
82 ],
83 "notResources": [
84 "string"
85 ],
86 "actions": [
87 "*"
88 ],
89 "notActions": [
90 "string"
91 ],
92 "role_name": "string"
93 }
94 }
95 ],
96 "allowed": [
97 {
98 "action": "string",
99 "reason": {
100 "effect": "allow",
101 "resources": [
102 "proj/*:env/*;qa_*:/flag/*"
103 ],
104 "notResources": [
105 "string"
106 ],
107 "actions": [
108 "*"
109 ],
110 "notActions": [
111 "string"
112 ],
113 "role_name": "string"
114 }
115 }
116 ]
117 },
118 "experiments": [
119 {
120 "key": "experiment-key-123abc",
121 "name": "Example experiment",
122 "environmentId": "1234a56b7c89d012345e678f",
123 "environmentKey": "production",
124 "creationDate": 1654104600000,
125 "_links": {
126 "parent": {
127 "href": "/api/v2/projects/my-project/environments/my-environment",
128 "type": "application/json"
129 },
130 "self": {
131 "href": "/api/v2/projects/my-project/environments/my-environment/experiments/example-experiment",
132 "type": "application/json"
133 }
134 },
135 "archivedDate": 1654104600000
136 }
137 ],
138 "experimentCount": 0,
139 "activeExperimentCount": 0,
140 "activeGuardedRolloutCount": 0
141 }
142 ],
143 "_links": {
144 "parent": {
145 "href": "/api/v2/projects/my-project",
146 "type": "application/json"
147 },
148 "self": {
149 "href": "/api/v2/projects/my-project/metric-groups",
150 "type": "application/json"
151 }
152 },
153 "totalCount": 1
154}
Get a list of all metric groups for the specified project. ### Expanding the metric groups response This endpoint does not support response expansion. Although the API accepts an `expand` query parameter for compatibility reasons, it does not currently modify the response. The parameter is reserved for future use. ### Filtering metric groups The `filter` parameter supports the following operators: `contains`, `equals`, `anyOf`. #### Supported fields and operators You can only filter certain fields in metrics when using the `filter` parameter. Additionally, you can only filter some fields with certain operators. When you search for metrics, the `filter` parameter supports the following fields and operators: |<div style="width:120px">Field</div> |Description |Supported operators | |---|---|---| | `experimentStatus` | The experiment's status. One of `not_started`, `running`, `stopped`, `started`. | `equals` | | `hasConnections` | Whether the metric group has connections to experiments or guarded rollouts. One of `true`, `false`. | `equals` | | `kind` | The metric group kind. One of `funnel`, `standard`. | `equals` | | `maintainerIds` | The metric maintainer IDs. | `anyOf` | | `maintainerTeamKey` | The metric maintainer team key. | `equals` | | `query` | A "fuzzy" search across metric group key and name. Supply a string or list of strings to the operator. | `equals` | ### Sorting metric groups LaunchDarkly supports the following fields for sorting: - `name` sorts by metric group name. - `createdAt` sorts by the creation date of the metric group. - `connectionCount` sorts by the number of connections to experiments the metric group has. By default, the sort is in ascending order. Use `-` to sort in descending order. For example, `?sort=name` sorts the response by metric group name in ascending order, and `?sort=-name` sorts in descending order. #### Sample query `filter=experimentStatus equals 'not_started' and query equals 'metric name'`
Was this page helpful?
Previous

Patch metric group

Next
Built with

Get a list of all metric groups for the specified project.

Expanding the metric groups response

This endpoint does not support response expansion.

Although the API accepts an expand query parameter for compatibility reasons, it does not currently modify the response. The parameter is reserved for future use.

Filtering metric groups

The filter parameter supports the following operators: contains, equals, anyOf.

Supported fields and operators

You can only filter certain fields in metrics when using the filter parameter. Additionally, you can only filter some fields with certain operators.

When you search for metrics, the filter parameter supports the following fields and operators:

Field
DescriptionSupported operators
experimentStatusThe experiment’s status. One of not_started, running, stopped, started.equals
hasConnectionsWhether the metric group has connections to experiments or guarded rollouts. One of true, false.equals
kindThe metric group kind. One of funnel, standard.equals
maintainerIdsThe metric maintainer IDs.anyOf
maintainerTeamKeyThe metric maintainer team key.equals
queryA “fuzzy” search across metric group key and name. Supply a string or list of strings to the operator.equals

Sorting metric groups

LaunchDarkly supports the following fields for sorting:

  • name sorts by metric group name.
  • createdAt sorts by the creation date of the metric group.
  • connectionCount sorts by the number of connections to experiments the metric group has.

By default, the sort is in ascending order. Use - to sort in descending order. For example, ?sort=name sorts the response by metric group name in ascending order, and ?sort=-name sorts in descending order.

Sample query

filter=experimentStatus equals 'not_started' and query equals 'metric name'

Authentication

Authorizationstring
API Key authentication via header

Path parameters

projectKeystringRequiredformat: "string"
The project key

Query parameters

filterstringOptionalformat: "string"

Accepts filter by experimentStatus, query, kind, hasConnections, maintainerIds, and maintainerTeamKey. Example: filter=experimentStatus equals 'running' and query equals 'test'.

sortstringOptionalformat: "string"

A comma-separated list of fields to sort by. Fields prefixed by a dash ( - ) sort in descending order. Read the endpoint description for a full list of available sort fields.

expandstringOptionalformat: "string"
This parameter is reserved for future use and is not currently supported on this endpoint.
limitlongOptional
The number of metric groups to return in the response. Defaults to 20. Maximum limit is 50.
offsetlongOptional

Where to start in the list. Use this with pagination. For example, an offset of 10 skips the first ten items and returns the next limit items.

Response

Metric group collection response
itemslist of objects
An array of metric groups
_linksmap from strings to objects
The location and content type of related resources
totalCountinteger

Errors

400
Bad Request Error
401
Unauthorized Error
403
Forbidden Error
404
Not Found Error
405
Method Not Allowed Error
429
Too Many Requests Error