Metrics
Update Metric
Update a metric; providing criteria replaces the criteria set and
bumps definition_version (PRD §7-I versioning).
PATCH
/
core
/
metrics
/
{metric_id}
Update Metric
curl --request PATCH \
--url https://api.anyreach.ai/core/metrics/{metric_id} \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"description": "<string>",
"perceiver": "<string>",
"panel_size": 123,
"routing_policy": {},
"gate_predicate": {},
"criteria": [
{
"question": "<string>",
"key": "<string>",
"expected_value": true,
"evidence_required": true,
"na_rule": "<string>",
"applies_when": {},
"applies_when_description": "<string>",
"source": "judge",
"rule": {},
"rule_description": "<string>",
"widget_hint": "checklist",
"display_order": 0
}
],
"archived_at": "2023-11-07T05:31:56Z"
}
'import requests
url = "https://api.anyreach.ai/core/metrics/{metric_id}"
payload = {
"name": "<string>",
"description": "<string>",
"perceiver": "<string>",
"panel_size": 123,
"routing_policy": {},
"gate_predicate": {},
"criteria": [
{
"question": "<string>",
"key": "<string>",
"expected_value": True,
"evidence_required": True,
"na_rule": "<string>",
"applies_when": {},
"applies_when_description": "<string>",
"source": "judge",
"rule": {},
"rule_description": "<string>",
"widget_hint": "checklist",
"display_order": 0
}
],
"archived_at": "2023-11-07T05:31:56Z"
}
headers = {"Content-Type": "application/json"}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
description: '<string>',
perceiver: '<string>',
panel_size: 123,
routing_policy: {},
gate_predicate: {},
criteria: [
{
question: '<string>',
key: '<string>',
expected_value: true,
evidence_required: true,
na_rule: '<string>',
applies_when: {},
applies_when_description: '<string>',
source: 'judge',
rule: {},
rule_description: '<string>',
widget_hint: 'checklist',
display_order: 0
}
],
archived_at: '2023-11-07T05:31:56Z'
})
};
fetch('https://api.anyreach.ai/core/metrics/{metric_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.anyreach.ai/core/metrics/{metric_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([
'name' => '<string>',
'description' => '<string>',
'perceiver' => '<string>',
'panel_size' => 123,
'routing_policy' => [
],
'gate_predicate' => [
],
'criteria' => [
[
'question' => '<string>',
'key' => '<string>',
'expected_value' => true,
'evidence_required' => true,
'na_rule' => '<string>',
'applies_when' => [
],
'applies_when_description' => '<string>',
'source' => 'judge',
'rule' => [
],
'rule_description' => '<string>',
'widget_hint' => 'checklist',
'display_order' => 0
]
],
'archived_at' => '2023-11-07T05:31:56Z'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$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.anyreach.ai/core/metrics/{metric_id}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"perceiver\": \"<string>\",\n \"panel_size\": 123,\n \"routing_policy\": {},\n \"gate_predicate\": {},\n \"criteria\": [\n {\n \"question\": \"<string>\",\n \"key\": \"<string>\",\n \"expected_value\": true,\n \"evidence_required\": true,\n \"na_rule\": \"<string>\",\n \"applies_when\": {},\n \"applies_when_description\": \"<string>\",\n \"source\": \"judge\",\n \"rule\": {},\n \"rule_description\": \"<string>\",\n \"widget_hint\": \"checklist\",\n \"display_order\": 0\n }\n ],\n \"archived_at\": \"2023-11-07T05:31:56Z\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
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.anyreach.ai/core/metrics/{metric_id}")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"perceiver\": \"<string>\",\n \"panel_size\": 123,\n \"routing_policy\": {},\n \"gate_predicate\": {},\n \"criteria\": [\n {\n \"question\": \"<string>\",\n \"key\": \"<string>\",\n \"expected_value\": true,\n \"evidence_required\": true,\n \"na_rule\": \"<string>\",\n \"applies_when\": {},\n \"applies_when_description\": \"<string>\",\n \"source\": \"judge\",\n \"rule\": {},\n \"rule_description\": \"<string>\",\n \"widget_hint\": \"checklist\",\n \"display_order\": 0\n }\n ],\n \"archived_at\": \"2023-11-07T05:31:56Z\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.anyreach.ai/core/metrics/{metric_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"perceiver\": \"<string>\",\n \"panel_size\": 123,\n \"routing_policy\": {},\n \"gate_predicate\": {},\n \"criteria\": [\n {\n \"question\": \"<string>\",\n \"key\": \"<string>\",\n \"expected_value\": true,\n \"evidence_required\": true,\n \"na_rule\": \"<string>\",\n \"applies_when\": {},\n \"applies_when_description\": \"<string>\",\n \"source\": \"judge\",\n \"rule\": {},\n \"rule_description\": \"<string>\",\n \"widget_hint\": \"checklist\",\n \"display_order\": 0\n }\n ],\n \"archived_at\": \"2023-11-07T05:31:56Z\"\n}"
response = http.request(request)
puts response.read_body{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Headers
Organization ID for user PATs (pat_ prefix tokens)
Path Parameters
Body
application/json
Schema for API requests to update a metric.
criteria, when provided, is a full replacement of the metric's criteria
(matched by key: existing keys update in place, missing keys archive, new
keys create) and bumps definition_version.
Available options:
objective, perceptual Available options:
transcript, audio Show child attributes
Show child attributes
Response
Successful Response
⌘I
Update Metric
curl --request PATCH \
--url https://api.anyreach.ai/core/metrics/{metric_id} \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"description": "<string>",
"perceiver": "<string>",
"panel_size": 123,
"routing_policy": {},
"gate_predicate": {},
"criteria": [
{
"question": "<string>",
"key": "<string>",
"expected_value": true,
"evidence_required": true,
"na_rule": "<string>",
"applies_when": {},
"applies_when_description": "<string>",
"source": "judge",
"rule": {},
"rule_description": "<string>",
"widget_hint": "checklist",
"display_order": 0
}
],
"archived_at": "2023-11-07T05:31:56Z"
}
'import requests
url = "https://api.anyreach.ai/core/metrics/{metric_id}"
payload = {
"name": "<string>",
"description": "<string>",
"perceiver": "<string>",
"panel_size": 123,
"routing_policy": {},
"gate_predicate": {},
"criteria": [
{
"question": "<string>",
"key": "<string>",
"expected_value": True,
"evidence_required": True,
"na_rule": "<string>",
"applies_when": {},
"applies_when_description": "<string>",
"source": "judge",
"rule": {},
"rule_description": "<string>",
"widget_hint": "checklist",
"display_order": 0
}
],
"archived_at": "2023-11-07T05:31:56Z"
}
headers = {"Content-Type": "application/json"}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
description: '<string>',
perceiver: '<string>',
panel_size: 123,
routing_policy: {},
gate_predicate: {},
criteria: [
{
question: '<string>',
key: '<string>',
expected_value: true,
evidence_required: true,
na_rule: '<string>',
applies_when: {},
applies_when_description: '<string>',
source: 'judge',
rule: {},
rule_description: '<string>',
widget_hint: 'checklist',
display_order: 0
}
],
archived_at: '2023-11-07T05:31:56Z'
})
};
fetch('https://api.anyreach.ai/core/metrics/{metric_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.anyreach.ai/core/metrics/{metric_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([
'name' => '<string>',
'description' => '<string>',
'perceiver' => '<string>',
'panel_size' => 123,
'routing_policy' => [
],
'gate_predicate' => [
],
'criteria' => [
[
'question' => '<string>',
'key' => '<string>',
'expected_value' => true,
'evidence_required' => true,
'na_rule' => '<string>',
'applies_when' => [
],
'applies_when_description' => '<string>',
'source' => 'judge',
'rule' => [
],
'rule_description' => '<string>',
'widget_hint' => 'checklist',
'display_order' => 0
]
],
'archived_at' => '2023-11-07T05:31:56Z'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$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.anyreach.ai/core/metrics/{metric_id}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"perceiver\": \"<string>\",\n \"panel_size\": 123,\n \"routing_policy\": {},\n \"gate_predicate\": {},\n \"criteria\": [\n {\n \"question\": \"<string>\",\n \"key\": \"<string>\",\n \"expected_value\": true,\n \"evidence_required\": true,\n \"na_rule\": \"<string>\",\n \"applies_when\": {},\n \"applies_when_description\": \"<string>\",\n \"source\": \"judge\",\n \"rule\": {},\n \"rule_description\": \"<string>\",\n \"widget_hint\": \"checklist\",\n \"display_order\": 0\n }\n ],\n \"archived_at\": \"2023-11-07T05:31:56Z\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
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.anyreach.ai/core/metrics/{metric_id}")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"perceiver\": \"<string>\",\n \"panel_size\": 123,\n \"routing_policy\": {},\n \"gate_predicate\": {},\n \"criteria\": [\n {\n \"question\": \"<string>\",\n \"key\": \"<string>\",\n \"expected_value\": true,\n \"evidence_required\": true,\n \"na_rule\": \"<string>\",\n \"applies_when\": {},\n \"applies_when_description\": \"<string>\",\n \"source\": \"judge\",\n \"rule\": {},\n \"rule_description\": \"<string>\",\n \"widget_hint\": \"checklist\",\n \"display_order\": 0\n }\n ],\n \"archived_at\": \"2023-11-07T05:31:56Z\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.anyreach.ai/core/metrics/{metric_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"perceiver\": \"<string>\",\n \"panel_size\": 123,\n \"routing_policy\": {},\n \"gate_predicate\": {},\n \"criteria\": [\n {\n \"question\": \"<string>\",\n \"key\": \"<string>\",\n \"expected_value\": true,\n \"evidence_required\": true,\n \"na_rule\": \"<string>\",\n \"applies_when\": {},\n \"applies_when_description\": \"<string>\",\n \"source\": \"judge\",\n \"rule\": {},\n \"rule_description\": \"<string>\",\n \"widget_hint\": \"checklist\",\n \"display_order\": 0\n }\n ],\n \"archived_at\": \"2023-11-07T05:31:56Z\"\n}"
response = http.request(request)
puts response.read_body{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}
