---
title: "Get metrics"
method: GET
path: "/v1/{organization}/metric/"
tags: ["Metric"]
---

# Get metrics

`GET /v1/{organization}/metric/`

Retrieve metrics that match the given filters.

#### Permissions
This endpoint may be impacted by the following permissions:
* Only metrics that the authenticated user has `Metric:GetMetric` permission for will be retrieved.

## Path parameters

- `organization` string, required

## Query parameters

- `id` string[] — The IDs of the metrics to retrieve.
- `limit` integer — The maximum number of metrics to return.
- `continuation_token` integer — The continuation token from the previous request used to retrieve the next page of metrics.
- `applied_to_service` string[] — The IDs of the services that the metric is applied to.
- `type` MetricValueType[] — The types of the metrics.
- `is_deleted` boolean — Whether the metric is deleted.
- `creator` string[] — The creators of the dynamic behavior sets.
- `tag` string[] — The tags of the dynamic behavior sets. Must be specified using the syntax `key:value`, which means to match all sets with the given `key` and `value` pair among its tags. If `value` is `*`, it means the `value` does not matter. If `value` is empty, it matches against when the value is `None`.
- `sort_by` string[] — The fields to sort the sets by. Supported fields are `updated_at`. Specify a `+` before the field name to indicate ascending sorting and `-` for descending sorting. Multiple fields can be specified to break ties.

## Headers

- `x-mongo-cluster-name` string, nullable — The Mongo cluster name to perform this request in. This is usually not needed unless the organization does not exist yet in the Amigo organization infra config database.
- `Sec-WebSocket-Protocol` string[]

## Response `200`

Succeeded

- SrcAppEndpointsMetricGetMetricsResponse
  - `metrics` MetricInstance[], required — The list of retrieved metrics.
    - `id` string, required — The ID of the metric.
    - `org_id` string, required — The organization ID of the metric.
    - `name` string, required — The name of the metric.
    - `applied_to_services` string[], required — The services that the metric is applied to.
    - `additional_notes` string, nullable, required — Additional notes about the metric.
    - `tags` Tag[], required — The tags of the metric.
      - `key` string, required
      - `value` string, nullable, required
    - `creator` AmigoLibMongoCollectionsMetricMetricUserInfo, required
      - `org_id` string, required
      - `user_id` string, required
    - `updated_by` AmigoLibMongoCollectionsMetricMetricUserInfo, required
      - `org_id` string, required
      - `user_id` string, required
    - `metric_value_type` 'boolean' | 'numerical' | 'categorical', required
    - `is_deleted` boolean, required — Whether the metric is deleted.
    - `created_at` string, date-time, required — The time when the metric is created.
    - `updated_at` string, date-time, required — The time when the metric is last updated.
  - `has_more` boolean, required — Whether there are more metrics to retrieve.
  - `continuation_token` unknown, required
  - `filter_values` SrcAppEndpointsMetricGetMetricsResponseFilterValues, required
    - `applied_to_services_ids` string[], required — A set of service IDs that have metrics applied to the service.
    - `creators` AmigoLibMongoCollectionsMetricMetricUserInfo[], required — A set of creator infos that created the metrics under the current filters.
      - `org_id` string, required
      - `user_id` string, required
    - `tags` string[], required — A set of tag keys that exist in the metrics under the current filters.
    - `types` string[], required — A set of metric types that exist in the metrics under the current filters.

## Other responses

- `401` — Invalid authorization credentials.
- `403` — Missing required permissions.
- `404` — Specified organization is not found.
- `422` — Invalid request path parameter or request query parameter failed validation.
- `429` — The user has exceeded the rate limit of 20 requests per minute for this endpoint.
- `503` — The service is going through temporary maintenance.

---

[API](https://skmtc.net/amigo/apis/amigo-api.md) · [All operations](https://skmtc.net/amigo/apis/amigo-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/amigo/amigo-api/revisions/f0f28319e448/schema)
