Dynamiq
Metrics

Test metrics

Runs one or more metric configurations against sample input without persisting anything, returning each metric's score. Useful for tuning a metric's prompt or settings before saving it. Each entry carries a metric configuration (with its type) and the input record to score; an optional input_transformer remaps the fields the metric receives.

POST
/v1/metrics/test

Authorization

personalAccessToken
AuthorizationBearer <token>

Personal Access Token of a Dynamiq user — the only credential accepted by the management API (api.*). Prefix dyn_pat_ (legacy uak_ tokens still authenticate). Send as Authorization: Bearer <token>.

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Body for POST /v1/metrics/test.

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/v1/metrics/test" \  -H "Content-Type: application/json" \  -d '{    "project_id": "405d8375-3514-403b-8c43-83ae74cfe0e9",    "metrics": [      {        "id": "string",        "metric": {}      }    ]  }'
{
  "data": {
    "results": [
      {
        "id": "string",
        "status": "string",
        "score": {
          "value": 0,
          "comment": "string"
        },
        "error": "string"
      }
    ]
  }
}
{
  "error": {
    "code": "bad_request",
    "message": "Bad Request",
    "details": {
      "input": "cannot be blank"
    }
  }
}
{
  "error": {
    "code": "unauthorized",
    "message": "Unauthorized"
  }
}
{
  "error": {
    "code": "forbidden",
    "message": "Forbidden"
  }
}
{
  "error": {
    "code": "not_found",
    "message": "Not Found"
  }
}