Deployments.ai Docs
Evaluations

Record a human or imported score for a trace

POST /v1/traces/{traceId}/score-results · SDK recordTraceScoreResult · CLI deployments eval score record

POST
/v1/traces/{traceId}/score-results

Requires observability:write.

Authorization

platformBearer
headerAuthorizationBearer <token>

Platform bearer credential accepted as an opaque API key or JWT.

Path Parameters

traceId*string

W3C trace ID (32 lowercase hex characters).

Match^[a-f0-9]{32}$

Header Parameters

x-deployments-organization*string
Match^[0-7][0-9A-HJKMNP-TV-Z]{25}$
x-deployments-project*string
Match^[0-7][0-9A-HJKMNP-TV-Z]{25}$
x-deployments-environment*string
Match^[0-7][0-9A-HJKMNP-TV-Z]{25}$
idempotency-key*string
Length1 <= length <= 512

Request Body

application/json
  1. body
label?string
Length1 <= length <= 64
rationale?string
Length1 <= length <= 2000
runId?string
Match^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$
scoreDefinitionId*string
Match^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$
spanId?string
Match^[a-f0-9]{16}$
value*number
Range0 <= value <= 1

Response Body

ScoreResultResponse

application/json
  1. response
agentDeploymentId?string
Match^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$
agentReleaseId?string
Match^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$
createdAt*string
Match^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z$
Formatdate-time
datasetCaseId?string
Match^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$
durationMs*integer
Range0 <= value <= 9007199254740991
errorClass?string
Value in"evaluator_failed""invalid_configuration""judge_invalid_output""judge_timeout""judge_unavailable""missing_evidence"
errorMessage?string
evaluationRunId?string
Match^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$
evaluatorVersionHash*string
Match^[a-f0-9]{64}$
evidenceRefs*array<>
executionStatus*string
Value in"error""succeeded"
humanActorPrincipalId?string
id*string
Match^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$
judge?
label?string
passed?boolean
rationale?string
revision*integer
Range1 <= value <= 9007199254740991
runId?string
Match^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$
scoreDefinitionId*string
Match^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$
scoreType*string
Value in"deterministic""human""imported""model-judged"
source*string
Value in"api""automatic""evaluation-run"
spanId?string
Match^[a-f0-9]{16}$
threshold*number
Range0 <= value <= 1
traceId*string
Match^[a-f0-9]{32}$
updatedAt*string
Match^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z$
Formatdate-time
value?number
Range0 <= value <= 1
version*integer
Range0 <= value <= 9007199254740991
curl -X POST "https://example.com/v1/traces/string/score-results" \  -H "x-deployments-organization: string" \  -H "x-deployments-project: string" \  -H "x-deployments-environment: string" \  -H "idempotency-key: string" \  -H "Content-Type: application/json" \  -d '{    "scoreDefinitionId": "string",    "value": 0  }'
{  "agentDeploymentId": "string",  "agentReleaseId": "string",  "createdAt": "2019-08-24T14:15:22Z",  "datasetCaseId": "string",  "durationMs": 0,  "errorClass": "evaluator_failed",  "errorMessage": "string",  "evaluationRunId": "string",  "evaluatorVersionHash": "string",  "evidenceRefs": [    {      "id": "string",      "kind": "message"    }  ],  "executionStatus": "error",  "humanActorPrincipalId": "string",  "id": "string",  "judge": {    "costUsdMicros": 0,    "inputTokens": 0,    "internalEvaluator": true,    "modelId": "string",    "outputTokens": 0  },  "label": "string",  "passed": true,  "rationale": "string",  "revision": 1,  "runId": "string",  "scoreDefinitionId": "string",  "scoreType": "deterministic",  "source": "api",  "spanId": "string",  "threshold": 0,  "traceId": "string",  "updatedAt": "2019-08-24T14:15:22Z",  "value": 0,  "version": 0}