Update metric
curl --request PATCH \
--url https://api.galtea.ai/v2/metrics/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Accuracy",
"description": "Measures the accuracy of responses",
"tags": [
"accuracy",
"quality"
]
}
'import requests
url = "https://api.galtea.ai/v2/metrics/{id}"
payload = {
"name": "Accuracy",
"description": "Measures the accuracy of responses",
"tags": ["accuracy", "quality"]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Accuracy',
description: 'Measures the accuracy of responses',
tags: ['accuracy', 'quality']
})
};
fetch('https://api.galtea.ai/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.galtea.ai/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([
'name' => 'Accuracy',
'description' => 'Measures the accuracy of responses',
'tags' => [
'accuracy',
'quality'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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.galtea.ai/v2/metrics/{id}"
payload := strings.NewReader("{\n \"name\": \"Accuracy\",\n \"description\": \"Measures the accuracy of responses\",\n \"tags\": [\n \"accuracy\",\n \"quality\"\n ]\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.galtea.ai/v2/metrics/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Accuracy\",\n \"description\": \"Measures the accuracy of responses\",\n \"tags\": [\n \"accuracy\",\n \"quality\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.galtea.ai/v2/metrics/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Accuracy\",\n \"description\": \"Measures the accuracy of responses\",\n \"tags\": [\n \"accuracy\",\n \"quality\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "metric_123",
"organizationId": "org_123",
"userId": "user_123",
"name": "Accuracy",
"description": "Measures the accuracy of responses",
"tags": [
"accuracy",
"quality"
],
"documentationUrl": "https://docs.example.com/metrics/accuracy",
"source": "PARTIAL_PROMPT",
"activeRevisionId": "revision_123",
"createdAt": "2023-11-07T05:31:56Z",
"disabledAt": "2023-11-07T05:31:56Z"
}{
"error": "Error type",
"message": "Error message description"
}{
"error": "Error type",
"message": "Error message description"
}{
"error": "Error type",
"message": "Error message description"
}{
"error": "Error type",
"message": "Error message description"
}Update metric
Change the name, description or tags of a metric. Every revision shows the change. Any other field answers 400: a change to a judge setting is a new revision. The id is a metric id. A revision id answers 404. See Metrics.
PATCH
/
v2
/
metrics
/
{id}
Update metric
curl --request PATCH \
--url https://api.galtea.ai/v2/metrics/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Accuracy",
"description": "Measures the accuracy of responses",
"tags": [
"accuracy",
"quality"
]
}
'import requests
url = "https://api.galtea.ai/v2/metrics/{id}"
payload = {
"name": "Accuracy",
"description": "Measures the accuracy of responses",
"tags": ["accuracy", "quality"]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Accuracy',
description: 'Measures the accuracy of responses',
tags: ['accuracy', 'quality']
})
};
fetch('https://api.galtea.ai/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.galtea.ai/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([
'name' => 'Accuracy',
'description' => 'Measures the accuracy of responses',
'tags' => [
'accuracy',
'quality'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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.galtea.ai/v2/metrics/{id}"
payload := strings.NewReader("{\n \"name\": \"Accuracy\",\n \"description\": \"Measures the accuracy of responses\",\n \"tags\": [\n \"accuracy\",\n \"quality\"\n ]\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.galtea.ai/v2/metrics/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Accuracy\",\n \"description\": \"Measures the accuracy of responses\",\n \"tags\": [\n \"accuracy\",\n \"quality\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.galtea.ai/v2/metrics/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Accuracy\",\n \"description\": \"Measures the accuracy of responses\",\n \"tags\": [\n \"accuracy\",\n \"quality\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "metric_123",
"organizationId": "org_123",
"userId": "user_123",
"name": "Accuracy",
"description": "Measures the accuracy of responses",
"tags": [
"accuracy",
"quality"
],
"documentationUrl": "https://docs.example.com/metrics/accuracy",
"source": "PARTIAL_PROMPT",
"activeRevisionId": "revision_123",
"createdAt": "2023-11-07T05:31:56Z",
"disabledAt": "2023-11-07T05:31:56Z"
}{
"error": "Error type",
"message": "Error message description"
}{
"error": "Error type",
"message": "Error message description"
}{
"error": "Error type",
"message": "Error message description"
}{
"error": "Error type",
"message": "Error message description"
}Authorizations
Headers
Path Parameters
Body
application/json
Response
Metric updated successfully. The body is the resource as its GET answers it.
Evaluation method for the metric. FULL_PROMPT is deprecated for creation — POST /metrics rejects it with a 400. Use PARTIAL_PROMPT for new AI Evaluation metrics. The value remains in the enum because existing FULL_PROMPT metrics are still returned by reads and filters. CLASSIFIER is the Classifier judge, accepted only where the deployment enables it.
Available options:
SELF_HOSTED, FULL_PROMPT, PARTIAL_PROMPT, HUMAN_EVALUATION, GEVAL, DEEPEVAL, DETERMINISTIC, CLASSIFIER Example:
"PARTIAL_PROMPT"