curl --request PATCH \
--url https://api.egp.scale.com/v5/span-assessments/{span_assessment_id} \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"comment": "<string>",
"rating": 3,
"rubric": {},
"metadata": {},
"overwrite": {}
}
'import requests
url = "https://api.egp.scale.com/v5/span-assessments/{span_assessment_id}"
payload = {
"comment": "<string>",
"rating": 3,
"rubric": {},
"metadata": {},
"overwrite": {}
}
headers = {
"x-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-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({comment: '<string>', rating: 3, rubric: {}, metadata: {}, overwrite: {}})
};
fetch('https://api.egp.scale.com/v5/span-assessments/{span_assessment_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.egp.scale.com/v5/span-assessments/{span_assessment_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([
'comment' => '<string>',
'rating' => 3,
'rubric' => [
],
'metadata' => [
],
'overwrite' => [
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-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.egp.scale.com/v5/span-assessments/{span_assessment_id}"
payload := strings.NewReader("{\n \"comment\": \"<string>\",\n \"rating\": 3,\n \"rubric\": {},\n \"metadata\": {},\n \"overwrite\": {}\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("x-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.egp.scale.com/v5/span-assessments/{span_assessment_id}")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"comment\": \"<string>\",\n \"rating\": 3,\n \"rubric\": {},\n \"metadata\": {},\n \"overwrite\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.egp.scale.com/v5/span-assessments/{span_assessment_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"comment\": \"<string>\",\n \"rating\": 3,\n \"rubric\": {},\n \"metadata\": {},\n \"overwrite\": {}\n}"
response = http.request(request)
puts response.read_body{
"assessment_id": "<string>",
"trace_id": "<string>",
"span_id": "<string>",
"created_by": "<string>",
"assessment_type": "comment",
"object": "span.assessment",
"comment": "<string>",
"rating": 3,
"approval": "approved",
"rubric": {},
"metadata": {},
"overwrite": {},
"account_id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Update span assessment
Update the content of an existing span assessment.
Only the assessment’s original creator may update it; a request from any other identity returns 403. Supplied fields overwrite the stored values and the merged result is re-validated against the assessment’s type, so the content must stay consistent with assessment_type (the matching content field present and no conflicting fields set) or the call returns 422. The span and trace an assessment is attached to cannot be changed through this endpoint. Returns 404 if no assessment with that id exists for the caller’s account.
curl --request PATCH \
--url https://api.egp.scale.com/v5/span-assessments/{span_assessment_id} \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"comment": "<string>",
"rating": 3,
"rubric": {},
"metadata": {},
"overwrite": {}
}
'import requests
url = "https://api.egp.scale.com/v5/span-assessments/{span_assessment_id}"
payload = {
"comment": "<string>",
"rating": 3,
"rubric": {},
"metadata": {},
"overwrite": {}
}
headers = {
"x-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-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({comment: '<string>', rating: 3, rubric: {}, metadata: {}, overwrite: {}})
};
fetch('https://api.egp.scale.com/v5/span-assessments/{span_assessment_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.egp.scale.com/v5/span-assessments/{span_assessment_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([
'comment' => '<string>',
'rating' => 3,
'rubric' => [
],
'metadata' => [
],
'overwrite' => [
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-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.egp.scale.com/v5/span-assessments/{span_assessment_id}"
payload := strings.NewReader("{\n \"comment\": \"<string>\",\n \"rating\": 3,\n \"rubric\": {},\n \"metadata\": {},\n \"overwrite\": {}\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("x-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.egp.scale.com/v5/span-assessments/{span_assessment_id}")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"comment\": \"<string>\",\n \"rating\": 3,\n \"rubric\": {},\n \"metadata\": {},\n \"overwrite\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.egp.scale.com/v5/span-assessments/{span_assessment_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"comment\": \"<string>\",\n \"rating\": 3,\n \"rubric\": {},\n \"metadata\": {},\n \"overwrite\": {}\n}"
response = http.request(request)
puts response.read_body{
"assessment_id": "<string>",
"trace_id": "<string>",
"span_id": "<string>",
"created_by": "<string>",
"assessment_type": "comment",
"object": "span.assessment",
"comment": "<string>",
"rating": 3,
"approval": "approved",
"rubric": {},
"metadata": {},
"overwrite": {},
"account_id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Authorizations
Headers
Path Parameters
Body
Request model for updating span assessment
Raw text feedback
Numerical rating (1-5)
1 <= x <= 5Approval status (approved/rejected)
approved, rejected Rule key-value pairs for rubric evaluation
Show child attributes
Show child attributes
Arbitrary JSON object for additional data
User corrections to span output
Type of assessment
comment, rating, approval, rubric, metadata, overwrite Response
Successful Response
Response model for span assessment
Unique identifier for the assessment
The trace this assessment is attached to
The span this assessment is attached to
User who submitted the assessment
Type of assessment
comment, rating, approval, rubric, metadata, overwrite "span.assessment"Raw text feedback
Numerical rating (1-5)
1 <= x <= 5Approval status (approved/rejected)
approved, rejected Rule key-value pairs for rubric evaluation
Show child attributes
Show child attributes
Arbitrary JSON object for additional data
User corrections to span output
Account this assessment belongs to
When this assessment was created
When this assessment was last updated

