Skip to main content
POST
Upsert one test-case result with scores
The TraceRoot SDKs call this endpoint for you; call it directly only where no SDK fits. It accepts a project API key only.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

run_id
string
required

Body

application/json

Upsert one test-case result. Idempotent on (run_id, test_case_id). trace_id may be null now and set on a later call (out-of-order arrival).

scores is genuinely optional and carries three distinct meanings, so the out-of-order flow (POST the result with its scores, then re-POST later just to attach the OTel trace_id) cannot destroy them: absent → leave the existing scores untouched, [] → clear them, non-empty → replace them. Do not give this a default_factory=list, which would collapse the first two cases.

Every optional field is a partial update: a key the caller omits keeps its stored value, while an explicit null clears it. Sending scores replaces the result's scores ([] clears them); omitting it leaves them alone.

input
string
required
Maximum string length: 1000000
status
enum<string>
required
Available options:
passed,
failed,
errored,
not_scored
test_case_id
string
required
Required string length: 1 - 64
baseline_output
string | null
Maximum string length: 1000000
candidate_output
string | null
Maximum string length: 1000000
change
enum<string> | null
Available options:
improved,
regressed,
unchanged
cost
number | null
Required range: x >= 0
duration_ms
integer | null
Required range: 0 <= x <= 9007199254740991
expected_output
string | null
Maximum string length: 1000000
scores
ScoreInput · object[]
Maximum array length: 200
task_error
string | null
Maximum string length: 10000
trace_id
string | null
Required string length: 1 - 64

Response

Successful Response

evaluation_result_id
string
required