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

# Search metrics

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

Search for metrics that match the given filters and contain the given query in its name. Only the top 50 results will be returned. The results
will be sorted by the relevance of the search query.

#### 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

- `query` string, required
- `applied_to_service` string[] — The IDs of the services that the metric is applied to.
- `type` MetricValueType[] — The types of the metrics.
- `creator` string[] — The creators of the metrics. Each value must be of the format `org_id,user_id`.
- `tag` string[] — The tags of the metrics. Must be specified using the syntax `key:value`, which means to match all metrics 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`.

## 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.

- SrcAppEndpointsMetricSearchMetricsResponse
  - `metrics` Metric[], required — The list of retrieved metrics.
    - `_id` string, required — The ID of the document.
    - `org_id` string, required — The ID of the organization.
    - `created_at` string, date-time
    - `updated_at` string, date-time
    - `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 has been deleted.

## 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)
