chart-barMetrics

Define and evaluate conversation quality metrics - boolean, numerical, or categorical - with automated scoring.

Manage organization-scoped measurement criteria for evaluating conversation quality. This page documents the core API endpoints for creating, configuring, evaluating, and retrieving metrics.

circle-info

What are Metrics? Metrics define measurable criteria for assessing conversation quality. They work with the simulation system for automated testing - when a simulation run completes, configured metrics are automatically evaluated against the conversation. Metrics can also be evaluated manually against any completed conversation via the Evaluate endpoint.

Overview

Metrics are evaluation criteria that produce typed results (boolean, numerical, or categorical) when applied to a conversation. They are used to:

  • Measure conversation quality after sessions complete (post-session evaluation).

  • Automate testing via the simulation system, where metrics score simulated conversations.

  • Manual evaluation of specific conversations on demand.

Metric Value Types

Each metric defines a value type that determines the shape of its evaluation results:

Type
Description
Configuration

boolean

True/false evaluation

No additional config needed

numerical

Numeric score within a range

Requires lower_bound and upper_bound

categorical

One of a set of named categories

Requires a categories list

Examples:

// Boolean: "Did the agent follow the safety protocol?"
{ "type": "boolean" }

// Numerical: "Rate empathy on a 1-10 scale"
{ "type": "numerical", "lower_bound": 1, "upper_bound": 10 }

// Categorical: "Classify the conversation outcome"
{ "type": "categorical", "categories": ["resolved", "escalated", "abandoned"] }

Evaluation Sources

Metric evaluation results include a source_type that indicates how the evaluation was triggered:

Source Type
Description

post-session

Automatically evaluated after a conversation ends

simulation

Evaluated as part of a simulation test run

manual

Triggered via the Evaluate Metrics API endpoint

Typical Lifecycle

  1. Create a metric with a name, description, value type, and service associations.

  2. Apply the metric to services so it is evaluated for their conversations.

  3. Optionally use the metric in simulation unit tests for automated quality checks.

  4. Evaluate manually against specific conversations as needed.

  5. Retrieve evaluation results to analyze conversation quality trends.

circle-exclamation

Create a Metric

Create a new metric with a name, description, value type, and service associations. The metric name must be unique within the organization.

Response (201):

circle-info

Rate Limit: 100 requests per minute.

Create a metric

post
/v1/{organization}/metric/

Create a metric.

Permissions

  • Metric:CreateMetric for the metric to create.
Authorizations
AuthorizationstringRequired

The username should be set to {org_id}_{user_id}, and the password should be the Amigo issued JWT token that identifies the user.

AuthorizationstringRequired

Amigo issued JWT token that identifies an user. It's issued either after logging in through the frontend, or manually through the SignInWithAPIKey endpoint.

X-ORG-IDstringRequired

An optional organization identifier that indicates from which organization the token is issued. This is used in rare cases where the user to authenticate is making a request for resources in another organization.

Path parameters
organizationstringRequired
Header parameters
x-mongo-cluster-nameany ofOptional

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.

stringOptional
or
nullOptional
Sec-WebSocket-Protocolstring[]OptionalDefault: []
Body
namestring · min: 1Required

The name of the metric. Must be unique within the organization.

descriptionstring · min: 1Required

The description of the metric.

applied_to_servicesstring[]Required

The services that the metric is applied to.

additional_notesany ofRequired

Additional notes about the metric.

string · min: 1Optional
or
nullOptional
metric_valueone ofRequired
or
or
Responses
post
/v1/{organization}/metric/

List Metrics

Retrieve metrics matching the given filters. Only metrics the authenticated user has Metric:GetMetric permission for are returned.

Common filters:

  • id=<id> (repeatable) - filter by specific IDs

  • applied_to_service=<service_id> (repeatable) - filter by associated service

  • type=boolean|numerical|categorical (repeatable) - filter by metric value type

  • is_deleted=true|false (default false) - include deleted metrics

  • creator=<org_id,user_id> (repeatable) - filter by creator

  • tag=key:value (repeatable; value may be * for any value or empty for null)

  • sort_by=+updated_at|-updated_at (repeatable)

  • limit (0-50, default 50), continuation_token (int, default 0)

circle-info

Rate Limit: 20 requests per minute.

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.
Authorizations
AuthorizationstringRequired

The username should be set to {org_id}_{user_id}, and the password should be the Amigo issued JWT token that identifies the user.

AuthorizationstringRequired

Amigo issued JWT token that identifies an user. It's issued either after logging in through the frontend, or manually through the SignInWithAPIKey endpoint.

X-ORG-IDstringRequired

An optional organization identifier that indicates from which organization the token is issued. This is used in rare cases where the user to authenticate is making a request for resources in another organization.

Path parameters
organizationstringRequired
Query parameters
idstring[]Optional

The IDs of the metrics to retrieve.

Default: []
limitinteger · max: 50Optional

The maximum number of metrics to return.

Default: 50
continuation_tokenintegerOptional

The continuation token from the previous request used to retrieve the next page of metrics.

Default: 0
applied_to_servicestring[]Optional

The IDs of the services that the metric is applied to.

Default: []
is_deletedbooleanOptional

Whether the metric is deleted.

Default: false
creatorstring[]Optional

The creators of the dynamic behavior sets.

Default: []
tagstring[]Optional

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.

Default: []
sort_bystring[]Optional

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.

Default: []
Header parameters
x-mongo-cluster-nameany ofOptional

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.

stringOptional
or
nullOptional
Sec-WebSocket-Protocolstring[]OptionalDefault: []
Responses
chevron-right
200

Succeeded

application/json
has_morebooleanRequired

Whether there are more metrics to retrieve.

continuation_tokenany ofRequired

The continuation token to use to retrieve the next set of metrics.

anyOptional
or
nullOptional
filter_valuesany ofRequired

For each filter that this endpoint supports that can take on dynamic values, this field includes what these values are. This is only provided for the first page in the pagination results.

Note that the values are counted assuming the authenticated user has access to all the metrics, so they might differ from how many are actually retrieved.

or
nullOptional
get
/v1/{organization}/metric/

Search Metrics

Search for metrics by text query. The query matches against metric names and descriptions. Returns the top 50 results sorted by relevance.

circle-info

Rate Limit: 20 requests per minute.

get
/v1/{organization}/metric/search/

Search for metrics that match the given filters and contain the given query in its name or description. 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.
Authorizations
AuthorizationstringRequired

The username should be set to {org_id}_{user_id}, and the password should be the Amigo issued JWT token that identifies the user.

AuthorizationstringRequired

Amigo issued JWT token that identifies an user. It's issued either after logging in through the frontend, or manually through the SignInWithAPIKey endpoint.

X-ORG-IDstringRequired

An optional organization identifier that indicates from which organization the token is issued. This is used in rare cases where the user to authenticate is making a request for resources in another organization.

Path parameters
organizationstringRequired
Query parameters
querystring · min: 1Required

The query to search for. Any metrics containing the terms in its name and description would be returned.

applied_to_servicestring[]Optional

The IDs of the services that the metric is applied to.

Default: []
creatorstring[]Optional

The creators of the metrics. Each value must be of the format org_id,user_id.

Default: []
tagstring[]Optional

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.

Default: []
Header parameters
x-mongo-cluster-nameany ofOptional

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.

stringOptional
or
nullOptional
Sec-WebSocket-Protocolstring[]OptionalDefault: []
Responses
chevron-right
200

Succeeded.

application/json
get
/v1/{organization}/metric/search/

Update a Metric

Update a metric's description, service associations, notes, or tags. All fields are optional; only provided fields are updated.

circle-exclamation
circle-info

Rate Limit: 20 requests per minute.

Update a metric

post
/v1/{organization}/metric/{metric_id}/

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.
Authorizations
AuthorizationstringRequired

The username should be set to {org_id}_{user_id}, and the password should be the Amigo issued JWT token that identifies the user.

AuthorizationstringRequired

Amigo issued JWT token that identifies an user. It's issued either after logging in through the frontend, or manually through the SignInWithAPIKey endpoint.

X-ORG-IDstringRequired

An optional organization identifier that indicates from which organization the token is issued. This is used in rare cases where the user to authenticate is making a request for resources in another organization.

Path parameters
organizationstringRequired
metric_idstringRequired

The ID of the metric to update.

Pattern: ^[a-f0-9]{24}$
Header parameters
x-mongo-cluster-nameany ofOptional

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.

stringOptional
or
nullOptional
Sec-WebSocket-Protocolstring[]OptionalDefault: []
Body
descriptionany ofOptional

The description of the metric. Only updated if set.

string · min: 1Optional
or
nullOptional
applied_to_servicesany ofOptional

The services that the metric is applied to. Only updated if set.

string[]Optional
or
nullOptional
additional_notesany ofOptional

Additional notes about the metric. Only updated if set.

Default: {}
string · min: 1Optional
or
object · _NotSetOptional

A specific type to indicate that a field is not set in the request.

or
nullOptional
tagsany ofOptional

The tags of the metric. Only updated if set.

or
nullOptional
Responses
chevron-right
200

Succeeded

application/json
anyOptional
post
/v1/{organization}/metric/{metric_id}/

No content

Delete a Metric

Delete a metric. The metric becomes non-modifiable and non-usable, but remains in the database for historical reference. You can still retrieve it by ID to view metrics that were evaluated in previous conversations.

circle-exclamation
circle-info

Rate Limit: 100 requests per minute.

Delete a metric

delete
/v1/{organization}/metric/{metric_id}/

Delete a metric. The metric is no longer modifiable or usable, but remains in the database. One can still retrieve it using its ID to view metrics that were evaluated in previous conversations.

This endpoint will error if the metric is used in any simulation unit tests.

Permissions

This endpoint requires the following permissions:

  • Metric:DeleteMetric for the metric to delete.
Authorizations
AuthorizationstringRequired

The username should be set to {org_id}_{user_id}, and the password should be the Amigo issued JWT token that identifies the user.

AuthorizationstringRequired

Amigo issued JWT token that identifies an user. It's issued either after logging in through the frontend, or manually through the SignInWithAPIKey endpoint.

X-ORG-IDstringRequired

An optional organization identifier that indicates from which organization the token is issued. This is used in rare cases where the user to authenticate is making a request for resources in another organization.

Path parameters
organizationstringRequired
metric_idstringRequired

The ID of the metric to update.

Pattern: ^[a-f0-9]{24}$
Header parameters
x-mongo-cluster-nameany ofOptional

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.

stringOptional
or
nullOptional
Sec-WebSocket-Protocolstring[]OptionalDefault: []
Responses
chevron-right
200

Succeeded.

application/json
anyOptional
delete
/v1/{organization}/metric/{metric_id}/

No content

Evaluate Metrics

Evaluate one or more metrics against a completed conversation. Results are stored and retrievable through the Get Evaluation Results endpoint with a source type of manual.

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

Request body:

Field
Type
Required
Description

metric_ids

array<string>

Yes

IDs of metrics to evaluate (1-10, must be unique)

conversation_id

string

Yes

ID of the completed conversation to evaluate

evaluate_to_interaction_id

string

No

If specified, only messages up to (and including) this interaction are evaluated

circle-info

The conversation must have at least one interaction, or the request returns HTTP 400.

circle-info

Rate Limit: 50 requests per minute.

Evaluate metrics

post
/v1/{organization}/metric/evaluate

Evaluate the specified metrics for a completed conversation. The results will be stored and retrievable through the GetMetricEvaluationResults 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.
Authorizations
AuthorizationstringRequired

The username should be set to {org_id}_{user_id}, and the password should be the Amigo issued JWT token that identifies the user.

AuthorizationstringRequired

Amigo issued JWT token that identifies an user. It's issued either after logging in through the frontend, or manually through the SignInWithAPIKey endpoint.

X-ORG-IDstringRequired

An optional organization identifier that indicates from which organization the token is issued. This is used in rare cases where the user to authenticate is making a request for resources in another organization.

Path parameters
organizationstringRequired
Header parameters
x-mongo-cluster-nameany ofOptional

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.

stringOptional
or
nullOptional
Sec-WebSocket-Protocolstring[]OptionalDefault: []
Body
metric_idsstring[] · min: 1 · max: 10Required

The IDs of the metrics to evaluate.

conversation_idstringRequired

The ID of the conversation to evaluate the metrics for.

Pattern: ^[a-f0-9]{24}$
evaluate_to_interaction_idany ofOptional

If specified, only messages up to (and including) this interaction will be evaluated.

stringOptionalPattern: ^[a-f0-9]{24}$
or
nullOptional
Responses
chevron-right
200

Succeeded.

application/json
post
/v1/{organization}/metric/evaluate

Get Evaluation Results

Retrieve metric evaluation results matching the given filters. Results include the metric ID, evaluated value, source type, and associated conversation or simulation run.

Common filters:

  • metric_id=<id> (repeatable) - filter by metric

  • source_type=post-session|manual|simulation (repeatable) - filter by evaluation source

  • conversation_id=<id> (repeatable) - filter by conversation (for post-session and manual sources)

  • simulation_unit_test_set_run_id=<id> (repeatable) - filter by simulation run (for simulation source)

  • timestamp_after=<ISO8601> - only results evaluated on or after this time

  • timestamp_before=<ISO8601> - only results evaluated on or before this time

  • sort_by=+created_at|-created_at (repeatable)

  • limit (0-500, default 500), continuation_token (int, default 0)

circle-info

Rate Limit: 10 requests per minute.

Get metric evaluation results

get
/v1/{organization}/metric/metric_evaluation_result

Retrieve metric evaluation results that match the given filters.

Permissions

This endpoint may be impacted by the following permissions:

  • Only metric evaluation results that the authenticated user has Metric:GetMetricEvaluationResult permission for will be retrieved.
Authorizations
AuthorizationstringRequired

The username should be set to {org_id}_{user_id}, and the password should be the Amigo issued JWT token that identifies the user.

AuthorizationstringRequired

Amigo issued JWT token that identifies an user. It's issued either after logging in through the frontend, or manually through the SignInWithAPIKey endpoint.

X-ORG-IDstringRequired

An optional organization identifier that indicates from which organization the token is issued. This is used in rare cases where the user to authenticate is making a request for resources in another organization.

Path parameters
organizationstringRequired
Query parameters
limitinteger · max: 500Optional

The maximum number of metrics to return.

Default: 500
continuation_tokenintegerOptional

The continuation token from the previous request used to retrieve the next page of metrics.

Default: 0
timestamp_afterany ofOptional

An ISO8601 timestamp. Only results evaluated on or after this moment is returned.

string · date-timeOptional
or
nullOptional
timestamp_beforeany ofOptional

An ISO8601 timestamp. Only results evaluated on or before this moment is returned.

string · date-timeOptional
or
nullOptional
metric_idstring[]Optional

The ID of the metric to retrieve.

Default: []
conversation_idstring[]Optional

For metric evaluation sources with type post-session or manual, this field filters the metric evaluation results to only include those that were computed from the given conversation IDs.

Default: []
simulation_unit_test_set_run_idstring[]Optional

For metric evaluation sources with type simulation, this field filters the metric evaluation results to only include those that were computed from the given simulation unit test set run IDs.

Default: []
sort_bystring[]Optional

The fields to sort the metrics by. Supported fields are created_at. Specify a + before the field name to indicate ascending sorting and - for descending sorting. Multiple fields can be specified to break ties.

Default: []
Header parameters
x-mongo-cluster-nameany ofOptional

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.

stringOptional
or
nullOptional
Sec-WebSocket-Protocolstring[]OptionalDefault: []
Responses
chevron-right
200

Succeeded

application/json
has_morebooleanRequired

Whether there are more metric evaluation results to retrieve.

continuation_tokenany ofRequired

The continuation token to use to retrieve the next set of metric evaluation results.

anyOptional
or
nullOptional
filter_valuesany ofRequired

For each filter that this endpoint supports that can take on dynamic values, this field includes what these values are. This is only provided for the first page in the pagination results.

Note that the values are counted assuming the authenticated user has access to all the metric evaluation results, so they might differ from how many are actually retrieved.

or
nullOptional
get
/v1/{organization}/metric/metric_evaluation_result

Last updated

Was this helpful?