---
title: "Update a metric"
method: POST
path: "/v1/{organization}/metric/{metric_id}/"
tags: ["Metric"]
---

# Update a metric

`POST /v1/{organization}/metric/{metric_id}/`

## Request

- Base URL: `https://api.amigo.ai`
- URL: `https://api.amigo.ai/v1/{organization}/metric/{metric_id}/`
- Auth: HTTP bearer and API key in header `X-ORG-ID` and HTTP basic
- TypeScript: <https://skmtc.dev/amigo/apis/amigo-api/docs/v1/:organization/metric/:metric_id/post.ts> (a function with typed inputs; its response is checked against the schema)

Update properties of a metric. The metric's name and metric values cannot be updated.

#### Permissions
This endpoint requires the following permissions:
* `Metric:ModifyMetric` for the metric to modify.

## Path parameters

- `organization` string, required
- `metric_id` string, required: The ID of the metric to update.

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

## Request body

- SrcAppEndpointsMetricUpdateMetricRequest
  - `applied_to_services` string[], nullable: The services that the metric is applied to. Only updated if set.
  - `additional_notes` union: Additional notes about the metric. Only updated if set.
    - string
    - NotSet: A specific type to indicate that a field is not set in the request.
  - `tags` object, nullable: The tags of the metric. Only updated if set.

## Response `200`

Succeeded

- unknown

## Other responses

- `401`: Invalid authorization credentials.
- `403`: Missing required permissions.
- `404`: Specified organization or metric is not found.
- `422`: Invalid request path parameter or request body 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.dev/amigo/apis/amigo-api.md) - [All operations](https://skmtc.dev/amigo/apis/amigo-api/llms.txt) - [OpenAPI document](https://skmtc.dev/amigo/apis/amigo-api/revisions/fd3c06d4bc2c?raw)
