Skip to main content
POST
Evaluate multiple sessions in one call

Authorizations

Authorization
string
header
required

API key authorization. Pass your API key in the Authorization header as a Bearer token. Both new (gsk_*) and legacy (gsk-) API keys are accepted, e.g. Authorization: Bearer gsk_... or Authorization: Bearer gsk-....

Body

application/json

Exactly one of sessionIds or versionId is required.

sessionIds
string[]

Explicit list of session IDs to evaluate. Mutually exclusive with versionId.

Example:
versionId
string

Evaluate every session attached to this version. Mutually exclusive with sessionIds.

Example:

"ver_123"

metrics
object[]

Metrics to evaluate. When provided, these exact metrics are applied to every session and per-specification scoping is bypassed. Optional: if omitted, each session is scored by the metrics of its own originating specification.

specificationIds
string[]

Specification IDs used to scope evaluation. If metrics is omitted, this is a strict allow-list: each session is evaluated only when its own originating specification is in the list, using just that spec's linked metrics; sessions whose spec is not listed (and imported sessions with no spec) are skipped. If metrics is also provided, the explicit metrics apply to every session and these specs' metrics are merged in (additive), with no per-session scoping.

Response

Batch evaluation processed

sessionsEvaluated
integer

Number of sessions whose evaluations were dispatched successfully. Sessions skipped during per-specification scoping are counted in neither this nor sessionsFailed. A session is skipped when its originating specification is outside the requested specificationIds, or when that specification has no linked metrics (which can happen even with no specificationIds filter). The count of skipped sessions and the reason for each cause are reported in message.

sessionsFailed
integer

Number of sessions whose evaluation failed.

evaluationsCreated
integer

Total number of Evaluation records created across all successful sessions.

failures
object[]

Per-session failure details.

message
string

Human-readable summary. Reports how many sessions were evaluated, failed, and skipped during per-specification scoping, naming each skip cause with its own count and reason (outside the requested specificationIds, or no linked metrics), plus any truncation note.

totalSessionsAvailable
integer | null

Total sessions matching the request (versionId mode only). When greater than the count actually evaluated the response was truncated to the first 1000 rows; the caller can re-issue the request with explicit sessionIds to cover the remainder. null in sessionIds mode.

truncated
boolean

True when the version had more sessions than the per-request page limit (1000).