Skip to main content
POST
/
v1
/
metrics
/
{metric_id}
/
thresholds
curl --request POST \
  --url https://api.coval.dev/v1/metrics/{metric_id}/thresholds \
  --header 'Content-Type: application/json' \
  --header 'X-API-Key: <api-key>' \
  --data '
{
  "comparison_operator": "gte",
  "target_float_upper": 0.8,
  "source": "manual"
}
'
{
  "threshold": {
    "name": "metrics/abc123def456ghi789jklm/threshold",
    "comparison_operator": "eq",
    "target_float_upper": 0.8,
    "target_float_lower": 123,
    "target_values": [
      "<string>"
    ],
    "source": "manual",
    "create_time": "2023-11-07T05:31:56Z",
    "update_time": "2023-11-07T05:31:56Z"
  }
}

Documentation Index

Fetch the complete documentation index at: https://docs.coval.dev/llms.txt

Use this file to discover all available pages before exploring further.

Authorizations

X-API-Key
string
header
required

API key for authentication

Path Parameters

metric_id
string
required

22-character metric ID

Pattern: ^[a-zA-Z0-9]{22}$

Body

application/json

Request body for creating a threshold

comparison_operator
enum<string>
required

Comparison operator for thresholds

Available options:
eq,
neq,
gt,
gte,
lt,
lte,
in,
nin,
bt,
nbt
target_float_upper
number | null

Target float value (upper bound for bt/nbt, single value for others)

target_float_lower
number | null

Lower bound for range operators (bt/nbt)

target_values
string[] | null

Target values for list operators (in/nin)

Required array length: 1 - 50 elements
source
enum<string>

Source of the threshold value

Available options:
manual,
model

Response

Threshold created successfully

threshold
object
required

Org-specific threshold for a metric