For the complete documentation index, see llms.txt. This page is also available as Markdown.

Metric

Create a new version for a metric

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

Create a new version for the given metric.

Permissions:

This endpoint requires the following permissions:

  • Metric:ModifyMetric for the metric to create a new version for.

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 create a new version for.

Pattern: ^[a-f0-9]{24}$
Query parameters
versioninteger · nullableOptional

The version number of the new metric version. If specified, this endpoint throws an error if the next version of the metric in the database doesn't equal to the value of this parameter.

Header parameters
x-mongo-cluster-namestring · nullableOptional

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-Protocolstring[]OptionalDefault: []
Body
descriptionstring · min: 1Required

The description of the metric. This tells the LLM what the metric is and how the metric result should be generated.

metric_valueone ofRequired
or
or
Responses
201

Succeeded.

application/json
versionintegerRequired

Numerical version ID for the version just created. For the first version of a metric, this field will be 1.

post/v1/{organization}/metric/{metric_id}/version/
POST /v1/{organization}/metric/{metric_id}/version/ 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: 85

{
  "description": "text",
  "metric_value": {
    "type": "text",
    "lower_bound": 1,
    "upper_bound": 1
  }
}
{
  "version": 1
}

Get metric versions

get
/v1/{organization}/metric/{metric_id}/version

Retrieve the versions of a metric.

Permissions

This endpoint requires the following permissions:

  • Metric:GetMetric for the metric whose versions to retrieve.

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 retrieve versions for.

Pattern: ^[a-f0-9]{24}$
Query parameters
versionstring · nullableOptional

The versions of the metric to retrieve. One can specify an exact version to retrieve, which is either the version number or latest, which retrieves the latest version. Alternatively, one can specify a range of inclusive lower and upper bound for the version number separated by -, and every version within the range would be retrieved.

Example: 1
limitinteger · max: 10Optional

The maximum number of metric versions to return.

Default: 10
continuation_tokenintegerOptional

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

Default: 0
sort_bystring[]Optional

The fields to sort the versions by. Supported fields are version. 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-namestring · nullableOptional

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-Protocolstring[]OptionalDefault: []
Responses
200

Succeeded.

application/json
has_morebooleanRequired

Whether there are more metric versions that can be retrieved with further pagination.

continuation_tokeninteger · nullableRequired

The continuation token to be used to retrieve the next page of metric versions. This is only included if has_more is true.

get/v1/{organization}/metric/{metric_id}/version
GET /v1/{organization}/metric/{metric_id}/version HTTP/1.1
Host: api.amigo.ai
Authorization: Bearer YOUR_SECRET_TOKEN
X-ORG-ID: YOUR_API_KEY
Accept: */*
{
  "metric_versions": [
    {
      "metric_id": "text",
      "version": 1,
      "description": "text",
      "metric_value": {
        "type": "text"
      },
      "creator": {
        "org_id": "text",
        "user_id": "text"
      },
      "created_at": "2026-01-01T00:00:00.000Z"
    }
  ],
  "has_more": true,
  "continuation_token": 1
}

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-namestring · nullableOptional

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-Protocolstring[]OptionalDefault: []
Responses
200

Succeeded

application/json
has_morebooleanRequired

Whether there are more metrics to retrieve.

continuation_tokenany · nullableRequired

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

get/v1/{organization}/metric/
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",
      "name": "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": "boolean",
      "is_deleted": true,
      "created_at": "2026-01-01T00:00:00.000Z",
      "updated_at": "2026-01-01T00:00:00.000Z"
    }
  ],
  "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

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-namestring · nullableOptional

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-Protocolstring[]OptionalDefault: []
Body
namestring · min: 1Required

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

applied_to_servicesstring[]Required

The services that the metric is applied to.

additional_notesstring · min: 1 · nullableRequired

Additional notes about the metric.

Responses
201

Succeeded

application/json
idstringRequired

The ID of the created metric.

post/v1/{organization}/metric/
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: 231

{
  "name": "text",
  "applied_to_services": [
    "text"
  ],
  "additional_notes": "text",
  "tags": {
    "ANY_ADDITIONAL_PROPERTY": "text"
  },
  "initial_version_metric_value": {
    "description": "text",
    "metric_value": {
      "type": "text",
      "lower_bound": 1,
      "upper_bound": 1
    }
  }
}
{
  "id": "text"
}

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-namestring · nullableOptional

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-Protocolstring[]OptionalDefault: []
Body
applied_to_servicesstring[] · nullableOptional

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

additional_notesany of · nullableOptional

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.

Responses
200

Succeeded

application/json
anyOptional
post/v1/{organization}/metric/{metric_id}/
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: 100

{
  "applied_to_services": [
    "text"
  ],
  "additional_notes": "text",
  "tags": {
    "ANY_ADDITIONAL_PROPERTY": "text"
  }
}

No content

Delete a metric

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

Delete a metric. The metric is no longer modifiable or manually evaluable, but remains stored, and existing services or simulations that evaluate this metric will continue to do so. One can still retrieve it using its ID to view its specifics.

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-namestring · nullableOptional

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-Protocolstring[]OptionalDefault: []
Responses
200

Succeeded.

application/json
anyOptional
delete/v1/{organization}/metric/{metric_id}/
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

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.

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 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-namestring · nullableOptional

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-Protocolstring[]OptionalDefault: []
Responses
200

Succeeded.

application/json
get/v1/{organization}/metric/search/
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": "2026-01-01T00:00:00.000Z",
      "updated_at": "2026-01-01T00:00:00.000Z",
      "name": "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": "boolean",
      "is_deleted": true
    }
  ]
}

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 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-namestring · nullableOptional

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-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_idstring · nullableOptional

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

Pattern: ^[a-f0-9]{24}$
Responses
200

Succeeded.

application/json
post/v1/{organization}/metric/evaluate
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",
      "value": 1,
      "references": [
        "text"
      ],
      "justification": "text"
    }
  ]
}

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_afterstring · date-time · nullableOptional

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

timestamp_beforestring · date-time · nullableOptional

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

metric_idstring[]OptionalDeprecated

The ID of the metric to retrieve.

Default: []
metric_id_and_versionstring[]Optional

The metric IDs and their versions to retrieve. Each value must be in the format of <metric_id>-<version>. If version is left empty, any versions of the metric would be retrieved.

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-namestring · nullableOptional

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-Protocolstring[]OptionalDefault: []
Responses
200

Succeeded

application/json
has_morebooleanRequired

Whether there are more metric evaluation results to retrieve.

continuation_tokenany · nullableRequired

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

get/v1/{organization}/metric/metric_evaluation_result
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": "2026-01-01T00:00:00.000Z",
      "updated_at": "2026-01-01T00:00:00.000Z",
      "metric_id": "text",
      "metric_version": 1,
      "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?