LogoLogo
Go to website
  • Welcome
  • Getting Started
    • Amigo Overview
      • System Components
      • Overcoming LLM Limitations
      • [Advanced] Future-Ready Architecture
      • [Advanced] The Accelerating AI Landscape
    • The Journey with Amigo
      • Partnership Model
  • Concepts
    • Agent Core
      • Core Persona
      • Global Directives
    • Context Graphs
      • State-Based Architecture
      • [Advanced] Field Implementation Guidance
    • Functional Memory
      • Layered Architecture
      • User Model
      • [Advanced] Recall Mechanisms
      • [Advanced] Analytical Capabilities
    • Dynamic Behaviors
      • Side-Effect Architecture
      • Knowledge
      • [Advanced] Behavior Chaining
    • Evaluations
      • Testing Framework Examples
    • [Advanced] Reinforcement Learning
    • Safety
  • Glossary
  • Advanced Topics
    • Transition to Neuralese Systems
    • Agent V2 Architecture
  • Agent Building Best Practices
    • Dynamic Behaviors Guide
  • Developer Guide
    • Enterprise Integration Guide
      • Authentication
      • User Creation + Management
      • Service Discovery + Management
      • Conversation Creation + Management
      • Data Retrieval + User Model Management
      • Webhook Management
    • API Reference
      • V1/organization
      • V1/service
      • V1/conversation
      • V1/user
      • V1/role
      • V1/admin
      • V1/webhook_destination
      • V1/metric
      • V1/dynamic_behavior_set
      • V1/simulation
      • Models
Powered by GitBook
LogoLogo

Resources

  • Pricing
  • About Us

Company

  • Careers

Policies

  • Terms of Service

Amigo Inc. ©2025 All Rights Reserved.


On this page

Was this helpful?

Export as PDF
  1. Developer Guide
  2. API Reference

V1/metric

PreviousV1/webhook_destinationNextV1/dynamic_behavior_set

Was this helpful?

Delete a metric

delete

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:

  • User:GetUserInfo for the authenticated user.

  • Metric:DeleteMetric for the metric to delete.

Authorizations
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
Responses
200
Succeeded.
application/json
Responseany
400
Metric is used in a simulation unit test.
401
Invalid authorization credentials.
403
Missing required permissions.
404
Specified organization or metric is not found.
422
Invalid request path parameter failed validation.
429
The user has exceeded the rate limit of 100 requests per minute for this endpoint.
503
The service is going through temporary maintenance.
delete
DELETE /v1/{organization}/metric/{metric_id}/ HTTP/1.1
Host: api.amigo.ai
Authorization: Bearer JWT
Accept: */*

No content

Search metrics

get

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 requires the following permissions:

  • User:GetUserInfo for the authenticated user.

This endpoint may be impacted by the following permissions:

  • Only metrics that the authenticated user has Metric:GetMetric permission for will be retrieved.

Authorizations
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_serviceany ofOptional

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

string[]Optional
or
nullOptional
typeany ofOptional

The types of the metrics.

or
nullOptional
creatorany ofOptional

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

string[]Optional
or
nullOptional
tagany ofOptional

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.

string[]Optional
or
nullOptional
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
Responses
200
Succeeded.
application/json
401
Invalid authorization credentials.
403
Missing required permissions.
404
Specified organization is not found.
422
Invalid request path parameter or request query parameter failed validation.
429
The user has exceeded the rate limit of 10 requests per minute for this endpoint.
503
The service is going through temporary maintenance.
get
GET /v1/{organization}/metric/search/ HTTP/1.1
Host: api.amigo.ai
Authorization: Bearer JWT
Accept: */*
{
  "metrics": [
    {
      "_id": "text",
      "org_id": "text",
      "name": "text",
      "description": "text",
      "applied_to_services": [
        "text"
      ],
      "additional_notes": "text",
      "tags": [
        {
          "key": "text",
          "value": "text"
        }
      ],
      "created_at": "2025-05-10T04:53:13.068Z",
      "creator": {
        "org_id": "text",
        "user_id": "text"
      },
      "updated_at": "2025-05-10T04:53:13.068Z",
      "updated_by": {
        "org_id": "text",
        "user_id": "text"
      },
      "metric_value": {
        "type": "text"
      },
      "is_deleted": true
    }
  ]
}
  • GETGet metrics
  • POSTCreate a metric
  • POSTUpdate a metric
  • DELETEDelete a metric
  • GETSearch metrics
  • POSTEvaluate metrics

Get metrics

get

Retrieve metrics that match the given filters.

Permissions

This endpoint requires the following permissions:

  • User:GetUserInfo for the authenticated user.

This endpoint may be impacted by the following permissions:

  • Only metrics that the authenticated user has Metric:GetMetric permission for will be retrieved.

Authorizations
Path parameters
organizationstringRequired
Query parameters
idany ofOptional

The ID of the metric to retrieve.

string[]Optional
or
nullOptional
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_serviceany ofOptional

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

string[]Optional
or
nullOptional
typeany ofOptional

The types of the metrics.

or
nullOptional
is_deletedbooleanOptional

Whether the metric is deleted.

Default: false
creatorany ofOptional

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

string[]Optional
or
nullOptional
tagany ofOptional

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.

string[]Optional
or
nullOptional
sort_bystring[]Optional

The fields to sort the metrics 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
Responses
200
Succeeded
application/json
401
Invalid authorization credentials.
403
Missing required permissions.
404
Specified organization is not found.
422
Invalid request path parameter or request query parameter failed validation.
429
The user has exceeded the rate limit of 10 requests per minute for this endpoint.
503
The service is going through temporary maintenance.
get
GET /v1/{organization}/metric/ HTTP/1.1
Host: api.amigo.ai
Authorization: Bearer JWT
Accept: */*
{
  "metrics": [
    {
      "_id": "text",
      "org_id": "text",
      "name": "text",
      "description": "text",
      "applied_to_services": [
        "text"
      ],
      "additional_notes": "text",
      "tags": [
        {
          "key": "text",
          "value": "text"
        }
      ],
      "created_at": "2025-05-10T04:53:13.068Z",
      "creator": {
        "org_id": "text",
        "user_id": "text"
      },
      "updated_at": "2025-05-10T04:53:13.068Z",
      "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

post

Create a metric.

Permissions

  • User:GetUserInfo for the authenticated user.

  • Metric:CreateMetric for the metric to create.

Authorizations
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
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
201
Succeeded
application/json
401
Invalid authorization credentials.
403
Missing required permissions.
404
Specified organization is not found.
409
A metric with this name already exists
422
Invalid request path parameter or request body failed validation.
429
The user has exceeded the rate limit of 100 requests per minute for this endpoint.
503
The service is going through temporary maintenance.
post
POST /v1/{organization}/metric/ HTTP/1.1
Host: api.amigo.ai
Authorization: Bearer JWT
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 a metric

post

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

Permissions

This endpoint requires the following permissions:

  • User:GetUserInfo for the authenticated user.

  • Metric:ModifyMetric for the metric to modify.

Authorizations
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
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
200
Succeeded
application/json
Responseany
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 100 requests per minute for this endpoint.
503
The service is going through temporary maintenance.
post
POST /v1/{organization}/metric/{metric_id}/ HTTP/1.1
Host: api.amigo.ai
Authorization: Bearer JWT
Content-Type: application/json
Accept: */*
Content-Length: 121

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

No content

Evaluate metrics

post

Evaluate the specified metrics for the given conversation, optionally up to the specified interaction.

Permissions

This endpoint requires the following permissions:

  • User:GetUserInfo for the authenticated user.

  • Metric:GetMetric for the metrics.

  • Metric:EvaluateMetric for the metrics.

Authorizations
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
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
200
Succeeded.
application/json
401
Invalid authorization credentials.
403
Missing required permissions.
404
Specified organization, conversation, interaction, 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.
post
POST /v1/{organization}/metric/evaluate HTTP/1.1
Host: api.amigo.ai
Authorization: Bearer JWT
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": "text",
      "references": [
        "text"
      ],
      "justification": "text"
    }
  ]
}