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:GetMetricpermission for will be retrieved.
Amigo issued JWT token that identifies an user. It's issued either after logging in through the frontend, or manually through the SignInWithAPIKey endpoint.
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.
The IDs of the metrics to retrieve.
[]The maximum number of metrics to return.
50The continuation token from the previous request used to retrieve the next page of metrics.
0The IDs of the services that the metric is applied to.
[]Whether the metric is deleted.
falseThe creators of the dynamic behavior sets.
[]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.
[]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.
[]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.
[]Succeeded
Invalid authorization credentials.
Missing required permissions.
Specified organization is not found.
Invalid request path parameter or request query parameter failed validation.
The user has exceeded the rate limit of 20 requests per minute for this endpoint.
The service is going through temporary maintenance.
GET /v1/{organization}/metric/ HTTP/1.1
Host: api.amigo.ai
Authorization: Bearer YOUR_SECRET_TOKEN
X-ORG-ID: YOUR_API_KEY
Accept: */*
{
"metrics": [
{
"id": "text",
"org_id": "text",
"created_at": "2025-11-13T18:52:55.386Z",
"updated_at": "2025-11-13T18:52:55.386Z",
"name": "text",
"description": "text",
"applied_to_services": [
"text"
],
"additional_notes": "text",
"tags": [
{
"key": "text",
"value": "text"
}
],
"creator": {
"org_id": "text",
"user_id": "text"
},
"updated_by": {
"org_id": "text",
"user_id": "text"
},
"metric_value": {
"type": "text"
},
"is_deleted": true
}
],
"has_more": true,
"continuation_token": null,
"filter_values": {
"applied_to_services_ids": [
"text"
],
"creators": [
{
"org_id": "text",
"user_id": "text"
}
],
"tags": [
"text"
],
"types": [
"text"
]
}
}Create a metric.
Permissions
Metric:CreateMetricfor the metric to create.
Amigo issued JWT token that identifies an user. It's issued either after logging in through the frontend, or manually through the SignInWithAPIKey endpoint.
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.
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.
[]The name of the metric. Must be unique within the organization.
The description of the metric.
The services that the metric is applied to.
Additional notes about the metric.
Succeeded
Invalid authorization credentials.
Missing required permissions.
Specified organization is not found.
A metric with this name already exists
Invalid request path parameter or request body failed validation.
The user has exceeded the rate limit of 100 requests per minute for this endpoint.
The service is going through temporary maintenance.
POST /v1/{organization}/metric/ HTTP/1.1
Host: api.amigo.ai
Authorization: Bearer YOUR_SECRET_TOKEN
X-ORG-ID: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 198
{
"name": "text",
"description": "text",
"applied_to_services": [
"text"
],
"additional_notes": "text",
"tags": {
"ANY_ADDITIONAL_PROPERTY": "text"
},
"metric_value": {
"type": "text",
"lower_bound": 1,
"upper_bound": 1
}
}{
"id": "text"
}Update properties of a metric. The metric's name and metric values cannot be updated.
Permissions
This endpoint requires the following permissions:
Metric:ModifyMetricfor the metric to modify.
Amigo issued JWT token that identifies an user. It's issued either after logging in through the frontend, or manually through the SignInWithAPIKey endpoint.
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.
The ID of the metric to update.
^[a-f0-9]{24}$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.
[]The description of the metric. Only updated if set.
The services that the metric is applied to. Only updated if set.
Additional notes about the metric. Only updated if set.
{}A specific type to indicate that a field is not set in the request.
The tags of the metric. Only updated if set.
Succeeded
Invalid authorization credentials.
Missing required permissions.
Specified organization or metric is not found.
Invalid request path parameter or request body failed validation.
The user has exceeded the rate limit of 20 requests per minute for this endpoint.
The service is going through temporary maintenance.
POST /v1/{organization}/metric/{metric_id}/ HTTP/1.1
Host: api.amigo.ai
Authorization: Bearer YOUR_SECRET_TOKEN
X-ORG-ID: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 121
{
"description": "text",
"applied_to_services": [
"text"
],
"additional_notes": "text",
"tags": {
"ANY_ADDITIONAL_PROPERTY": "text"
}
}No content
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:DeleteMetricfor the metric to delete.
Amigo issued JWT token that identifies an user. It's issued either after logging in through the frontend, or manually through the SignInWithAPIKey endpoint.
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.
The ID of the metric to update.
^[a-f0-9]{24}$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.
[]Succeeded.
Metric is used in a simulation unit test.
Invalid authorization credentials.
Missing required permissions.
Specified organization or metric is not found.
Invalid request path parameter failed validation.
The user has exceeded the rate limit of 100 requests per minute for this endpoint.
The service is going through temporary maintenance.
DELETE /v1/{organization}/metric/{metric_id}/ HTTP/1.1
Host: api.amigo.ai
Authorization: Bearer YOUR_SECRET_TOKEN
X-ORG-ID: YOUR_API_KEY
Accept: */*
No content
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:GetMetricpermission for will be retrieved.
Amigo issued JWT token that identifies an user. It's issued either after logging in through the frontend, or manually through the SignInWithAPIKey endpoint.
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.
The query to search for. Any metrics containing the terms in its name and description would be returned.
The IDs of the services that the metric is applied to.
[]The creators of the metrics. Each value must be of the format org_id,user_id.
[]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.
[]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.
[]Succeeded.
Invalid authorization credentials.
Missing required permissions.
Specified organization is not found.
Invalid request path parameter or request query parameter failed validation.
The user has exceeded the rate limit of 20 requests per minute for this endpoint.
The service is going through temporary maintenance.
GET /v1/{organization}/metric/search/?query=text HTTP/1.1
Host: api.amigo.ai
Authorization: Bearer YOUR_SECRET_TOKEN
X-ORG-ID: YOUR_API_KEY
Accept: */*
{
"metrics": [
{
"_id": "text",
"org_id": "text",
"created_at": "2025-11-13T18:52:55.386Z",
"updated_at": "2025-11-13T18:52:55.386Z",
"name": "text",
"description": "text",
"applied_to_services": [
"text"
],
"additional_notes": "text",
"tags": [
{
"key": "text",
"value": "text"
}
],
"creator": {
"org_id": "text",
"user_id": "text"
},
"updated_by": {
"org_id": "text",
"user_id": "text"
},
"metric_value": {
"type": "text"
},
"is_deleted": true
}
]
}Evaluate the specified metrics for the given conversation, optionally up to the specified interaction.
Permissions
This endpoint requires the following permissions:
Metric:EvaluateMetricfor the metrics.Metric:GetMetricEvaluationResultfor the metric results.
Amigo issued JWT token that identifies an user. It's issued either after logging in through the frontend, or manually through the SignInWithAPIKey endpoint.
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.
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.
[]The IDs of the metrics to evaluate.
The ID of the conversation to evaluate the metrics for.
^[a-f0-9]{24}$If specified, only messages up to (and including) this interaction will be evaluated.
^[a-f0-9]{24}$Succeeded.
The conversation has no interactions.
Invalid authorization credentials.
Missing required permissions.
Specified organization, conversation, interaction, or metric is not found.
Invalid request path parameter or request body failed validation.
The user has exceeded the rate limit of 20 requests per minute for this endpoint.
The service is going through temporary maintenance.
POST /v1/{organization}/metric/evaluate HTTP/1.1
Host: api.amigo.ai
Authorization: Bearer YOUR_SECRET_TOKEN
X-ORG-ID: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 84
{
"metric_ids": [
"text"
],
"conversation_id": "text",
"evaluate_to_interaction_id": "text"
}{
"metrics": [
{
"metric_id": "text",
"name": "text",
"value": 1,
"references": [
"text"
],
"justification": "text"
}
]
}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:GetMetricEvaluationResultpermission for will be retrieved.
Amigo issued JWT token that identifies an user. It's issued either after logging in through the frontend, or manually through the SignInWithAPIKey endpoint.
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.
The maximum number of metrics to return.
500The continuation token from the previous request used to retrieve the next page of metrics.
0An ISO8601 timestamp. Only results evaluated on or after this moment is returned.
An ISO8601 timestamp. Only results evaluated on or before this moment is returned.
The ID of the metric to retrieve.
[]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.
[]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.
[]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.
[]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.
[]Succeeded
Invalid authorization credentials.
Missing required permissions.
Specified organization is not found.
Invalid request path parameter or request query parameter failed validation.
The user has exceeded the rate limit of 10 requests per minute for this endpoint.
The service is going through temporary maintenance.
GET /v1/{organization}/metric/metric_evaluation_result HTTP/1.1
Host: api.amigo.ai
Authorization: Bearer YOUR_SECRET_TOKEN
X-ORG-ID: YOUR_API_KEY
Accept: */*
{
"metric_evaluation_results": [
{
"id": "text",
"org_id": "text",
"created_at": "2025-11-13T18:52:55.386Z",
"updated_at": "2025-11-13T18:52:55.386Z",
"metric_id": "text",
"result": 1,
"justification": "text",
"source": {
"type": "post-session",
"conversation_id": "text",
"references": [
"text"
]
}
}
],
"has_more": true,
"continuation_token": null,
"filter_values": {
"metric_ids": [
"text"
]
}
}Last updated
Was this helpful?

