Update a metric (partial)
curl --request PATCH \
--url https://api.cekura.ai/test_framework/v2/metrics/{id}/ \
--header 'Content-Type: application/json' \
--header 'X-CEKURA-API-KEY: <api-key>' \
--data '
{
"description": "Updated rubric",
"is_critical": true
}
'import requests
url = "https://api.cekura.ai/test_framework/v2/metrics/{id}/"
payload = {
"description": "Updated rubric",
"is_critical": True
}
headers = {
"X-CEKURA-API-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'X-CEKURA-API-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({description: 'Updated rubric', is_critical: true})
};
fetch('https://api.cekura.ai/test_framework/v2/metrics/{id}/', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.cekura.ai/test_framework/v2/metrics/{id}/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'description' => 'Updated rubric',
'is_critical' => true
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-CEKURA-API-KEY: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.cekura.ai/test_framework/v2/metrics/{id}/"
payload := strings.NewReader("{\n \"description\": \"Updated rubric\",\n \"is_critical\": true\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("X-CEKURA-API-KEY", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://api.cekura.ai/test_framework/v2/metrics/{id}/")
.header("X-CEKURA-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"description\": \"Updated rubric\",\n \"is_critical\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.cekura.ai/test_framework/v2/metrics/{id}/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["X-CEKURA-API-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"description\": \"Updated rubric\",\n \"is_critical\": true\n}"
response = http.request(request)
puts response.read_body{
"name": "<string>",
"eval_type": "binary",
"id": 123,
"slug": "<string>",
"project": 123,
"agents": [
123
],
"description": "<string>",
"type": "basic",
"enum_values": "<unknown>",
"audio_enabled": true,
"prompt": "<string>",
"evaluation_trigger": "always",
"trigger_type": "llm_judge",
"evaluation_trigger_prompt": "<string>",
"evaluation_trigger_custom_code": "<string>",
"priority_assignment_prompt": "<string>",
"configuration": "<unknown>",
"overall_score": "<string>",
"total_score": "<string>",
"knowledge_base_files": "<string>",
"observability_enabled": true,
"simulation_enabled": true,
"sampling_enabled": true,
"sample_rate": 0.5,
"alert_enabled": true,
"alert_type": "disabled",
"alert_filters": "<unknown>",
"slack_workspace": 123,
"slack_channel_id": "<string>",
"significant_change_alert_status": "enabled",
"significant_change_alert_direction": "",
"function_name": "<string>",
"custom_code": "<string>",
"vocera_defined_metric_code": "<string>",
"reviews": [
{
"metric": 123,
"id": 123,
"test_set": {
"agent": 123,
"id": 123,
"name": "<string>",
"transcript": "<string>",
"voice_recording_url": "<string>",
"call_end_reason": "<string>",
"duration": "<string>",
"source_model": "CallLog",
"source_id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
},
"expected_value": "<unknown>",
"actual_value": "<unknown>",
"explanation": "<unknown>",
"feedback": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
],
"window_size": 123,
"std_multiplier": 123,
"ewma_alpha": 123,
"add_to_new_agents": true,
"pending_optimisation_proposal": "<unknown>",
"dependencies": [
{
"id": 123,
"name": "<string>",
"slug": "<string>",
"source": "declared"
}
],
"dependents": [
{
"id": 123,
"name": "<string>",
"slug": "<string>",
"source": "declared"
}
]
}{
"field_name": [
"<string>"
]
}{
"detail": "<string>"
}Metrics
Update Metric
Partially update a metric. Same field shape as create — see metrics_create for details.
PATCH
/
test_framework
/
v2
/
metrics
/
{id}
/
Update a metric (partial)
curl --request PATCH \
--url https://api.cekura.ai/test_framework/v2/metrics/{id}/ \
--header 'Content-Type: application/json' \
--header 'X-CEKURA-API-KEY: <api-key>' \
--data '
{
"description": "Updated rubric",
"is_critical": true
}
'import requests
url = "https://api.cekura.ai/test_framework/v2/metrics/{id}/"
payload = {
"description": "Updated rubric",
"is_critical": True
}
headers = {
"X-CEKURA-API-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'X-CEKURA-API-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({description: 'Updated rubric', is_critical: true})
};
fetch('https://api.cekura.ai/test_framework/v2/metrics/{id}/', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.cekura.ai/test_framework/v2/metrics/{id}/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'description' => 'Updated rubric',
'is_critical' => true
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-CEKURA-API-KEY: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.cekura.ai/test_framework/v2/metrics/{id}/"
payload := strings.NewReader("{\n \"description\": \"Updated rubric\",\n \"is_critical\": true\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("X-CEKURA-API-KEY", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://api.cekura.ai/test_framework/v2/metrics/{id}/")
.header("X-CEKURA-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"description\": \"Updated rubric\",\n \"is_critical\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.cekura.ai/test_framework/v2/metrics/{id}/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["X-CEKURA-API-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"description\": \"Updated rubric\",\n \"is_critical\": true\n}"
response = http.request(request)
puts response.read_body{
"name": "<string>",
"eval_type": "binary",
"id": 123,
"slug": "<string>",
"project": 123,
"agents": [
123
],
"description": "<string>",
"type": "basic",
"enum_values": "<unknown>",
"audio_enabled": true,
"prompt": "<string>",
"evaluation_trigger": "always",
"trigger_type": "llm_judge",
"evaluation_trigger_prompt": "<string>",
"evaluation_trigger_custom_code": "<string>",
"priority_assignment_prompt": "<string>",
"configuration": "<unknown>",
"overall_score": "<string>",
"total_score": "<string>",
"knowledge_base_files": "<string>",
"observability_enabled": true,
"simulation_enabled": true,
"sampling_enabled": true,
"sample_rate": 0.5,
"alert_enabled": true,
"alert_type": "disabled",
"alert_filters": "<unknown>",
"slack_workspace": 123,
"slack_channel_id": "<string>",
"significant_change_alert_status": "enabled",
"significant_change_alert_direction": "",
"function_name": "<string>",
"custom_code": "<string>",
"vocera_defined_metric_code": "<string>",
"reviews": [
{
"metric": 123,
"id": 123,
"test_set": {
"agent": 123,
"id": 123,
"name": "<string>",
"transcript": "<string>",
"voice_recording_url": "<string>",
"call_end_reason": "<string>",
"duration": "<string>",
"source_model": "CallLog",
"source_id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
},
"expected_value": "<unknown>",
"actual_value": "<unknown>",
"explanation": "<unknown>",
"feedback": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
],
"window_size": 123,
"std_multiplier": 123,
"ewma_alpha": 123,
"add_to_new_agents": true,
"pending_optimisation_proposal": "<unknown>",
"dependencies": [
{
"id": 123,
"name": "<string>",
"slug": "<string>",
"source": "declared"
}
],
"dependents": [
{
"id": 123,
"name": "<string>",
"slug": "<string>",
"source": "declared"
}
]
}{
"field_name": [
"<string>"
]
}{
"detail": "<string>"
}Authorizations
api_keyoauth2embedded_sessionsupabase_session
Body
application/jsonapplication/x-www-form-urlencodedmultipart/form-data
Python custom code to determine metric relevance. Code should set _result (bool) and _explanation (str). Example:
_result = True _explanation = "Metric is relevant" if "call_end_reason" in data and data["call_end_reason"] == "customer-hung-up": _result = False _explanation = "Customer hung up, metric not applicable"
Response
Read-only inputs and dependents of a metric, resolved once per project.
Python custom code to determine metric relevance. Code should set _result (bool) and _explanation (str). Example:
_result = True _explanation = "Metric is relevant" if "call_end_reason" in data and data["call_end_reason"] == "customer-hung-up": _result = False _explanation = "Customer hung up, metric not applicable"