Skip to main content
POST
/
evaluations
/
fromSessions
Evaluate multiple sessions in one call
curl --request POST \
  --url https://api.galtea.ai/evaluations/fromSessions \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "sessionIds": [
    "ses_123",
    "ses_456"
  ],
  "versionId": "ver_123",
  "metrics": [
    {
      "id": "metric_123",
      "name": "Example Name",
      "score": 0.95
    }
  ],
  "specificationIds": [
    "<string>"
  ]
}
'
{
  "sessionsEvaluated": 123,
  "sessionsFailed": 123,
  "evaluationsCreated": 123,
  "failures": [
    {
      "sessionId": "<string>",
      "error": "<string>"
    }
  ],
  "message": "<string>",
  "totalSessionsAvailable": 123,
  "truncated": true
}

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:
["ses_123", "ses_456"]
versionId
string

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

Example:

"ver_123"

metrics
object[]

Metrics to evaluate per session. Optional if specificationIds is provided or the product has specifications with linked metrics.

specificationIds
string[]

Specification IDs whose linked metrics will be evaluated against each session. Can be combined with metrics; the API merges and deduplicates.

Response

Batch evaluation processed

sessionsEvaluated
integer

Number of sessions whose evaluations were dispatched successfully.

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
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).