Dynamiq
Metrics

Update a metric

Updates a metric's type and config. Each update records a new immutable version; earlier versions remain retrievable through the versions endpoints.

PUT
/v1/metrics/{metric_id}

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

Path Parameters

metric_id*string

Metric UUID.

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Body for PUT /v1/metrics/{metric_id}. Applying an update records a new metric version.

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X PUT "https://example.com/v1/metrics/497f6eca-6276-4993-bfeb-53cbbbba6f08" \  -H "Content-Type: application/json" \  -d '{    "type": "llm_as_a_judge",    "config": {}  }'
{
  "data": {
    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
    "name": "string",
    "project_id": "405d8375-3514-403b-8c43-83ae74cfe0e9",
    "type": "llm_as_a_judge",
    "config": {},
    "latest_version_id": "8562ca50-d99e-4ec5-9529-9c17b0fd462e",
    "created_at": "2019-08-24T14:15:22Z",
    "updated_at": "2019-08-24T14:15:22Z",
    "created_by": {
      "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
      "first_name": "string",
      "last_name": "string",
      "avatar_url": "string"
    },
    "updated_by": {
      "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
      "first_name": "string",
      "last_name": "string",
      "avatar_url": "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"
  }
}