Skip to main content
POST
/
v1
/
metrics
/
{metric_id}
/
versions
Create a new metric version
curl --request POST \
  --url https://api.honeyhive.ai/v1/metrics/{metric_id}/versions \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "message": "<string>",
  "content": {
    "name": "<string>",
    "criteria": "<string>",
    "description": "",
    "return_type": "float",
    "enabled_in_prod": false,
    "needs_ground_truth": false,
    "sampling_percentage": 10,
    "model_provider": "<string>",
    "model_name": "<string>",
    "scale": 123,
    "threshold": {
      "min": 123,
      "max": 123,
      "pass_when": true,
      "passing_categories": [
        "<string>"
      ]
    },
    "categories": [
      {
        "category": "<string>",
        "score": 123
      }
    ],
    "child_metrics": [
      {
        "name": "<string>",
        "weight": 123,
        "id": "<string>",
        "scale": 123
      }
    ],
    "filters": {
      "filterArray": []
    }
  },
  "deploy_immediately": true
}
'
{
  "success": true,
  "data": {
    "name": "<string>",
    "full_sha": "<string>",
    "message": "<string>",
    "date": "2023-11-07T05:31:56Z",
    "deployed": true,
    "content": {
      "name": "<string>",
      "criteria": "<string>",
      "description": "<string>",
      "enabled_in_prod": true,
      "needs_ground_truth": true,
      "sampling_percentage": 50,
      "filters": {
        "filterArray": [
          {
            "field": "<string>",
            "value": "<string>"
          }
        ]
      },
      "model_provider": "<string>",
      "model_name": "<string>",
      "scale": 123,
      "threshold": {
        "min": 123,
        "max": 123,
        "pass_when": true,
        "passing_categories": [
          "<string>"
        ]
      },
      "categories": [
        {
          "category": "<string>",
          "score": 123
        }
      ],
      "child_metrics": [
        {
          "name": "<string>",
          "weight": 123,
          "id": "<string>",
          "scale": 123
        }
      ]
    }
  }
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

metric_id
string
required

The unique identifier of the metric to version

Body

application/json

Request body for POST /v1/metrics/{metric_id}/versions

message
string
required
content
object
required

Metric definition snapshot accepted by POST /v1/metrics/{metric_id}/versions. Six fields are optional and fall back to server-side defaults when omitted:

  • description""
  • return_type"float"
  • enabled_in_prodtrue for HUMAN metrics, false otherwise
  • needs_ground_truthfalse
  • sampling_percentage10
  • filters{ "filterArray": [] }
deploy_immediately
boolean

Response

Metric version created successfully

Response for POST /v1/metrics/{metric_id}/versions

success
enum<boolean>
required
Available options:
true
data
object
required

A versioned snapshot of a metric definition.