---
title: "Evaluate metrics"
method: POST
path: "/v1/{organization}/metric/evaluate"
tags: ["Metric"]
---

# Evaluate metrics

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

Evaluate the latest versions of specified metrics for a completed conversation. The results will be stored and retrievable through the [`GetMetricEvaluationResults`](get-metric-evaluation-results)
endpoint with a special source type of `manual`.

If the same conversation has been manually evaluated for the same metric, the previous evaluation result will be overwritten.

#### Permissions
This endpoint requires the following permissions:
* `Metric:GetMetric` for the metrics.
* `Metric:EvaluateMetric` for the metrics.
* `Metric:GetMetricEvaluationResult` for the metric results.

## Path parameters

- `organization` string, required

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

- SrcAppEndpointsMetricEvaluateMetricsRequest
  - `metric_ids` string[], required — The IDs of the metrics to evaluate.
  - `conversation_id` string, required — The ID of the conversation to evaluate the metrics for.
  - `evaluate_to_interaction_id` string, nullable — If specified, only messages up to (and including) this interaction will be evaluated.

## Response `200`

Succeeded.

- SrcAppEndpointsMetricEvaluateMetricsResponse
  - `metrics` AmigoLibAgentMetricMetricAgentMetricEvaluationResult[], required — A list of the evaluated metrics, in the same order that the `metrics` field in the request is presented.
    - `metric_id` string, required — The ID of the metric for which this value was computed.
    - `value` union, required — The value of the metric.
      - number
      - boolean
      - string
    - `references` string[], required — A list of references to the messages that were used to compute this metric.
    - `justification` string, required — A justification for the metric value.

## Other responses

- `400` — The conversation has no interactions.
- `401` — Invalid authorization credentials.
- `403` — Missing required permissions.
- `404` — Specified organization, conversation, or metric is not found.
- `422` — Invalid request path parameter or request body failed validation.
- `429` — The user has exceeded the rate limit of 50 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)
