Skip to content

List span or trace assessments

GET/v5/span-assessments

Return the assessments attached to a given span or trace.

Results are scoped to the caller’s account. Exactly one of span_id or trace_id must be supplied as a query parameter, and a request providing neither returns 400. Filtering by trace_id returns assessments across every span of that trace, whereas span_id returns only that span’s assessments; an optional assessment_type narrows the results to a single type. Use the get-by-id endpoint when you already have a specific assessment id.

Query ParametersExpand Collapse
assessment_type: optional AssessmentType

Filter by assessment type

One of the following:
"comment"
"rating"
"approval"
"rubric"
"metadata"
"overwrite"
span_id: optional string

Filter by span ID. Either span_id or trace_id must be provided as a query parameter.

trace_id: optional string

Filter by trace ID. Either span_id or trace_id must be provided as a query parameter.

ReturnsExpand Collapse
items: array of SpanAssessment { assessment_id, assessment_type, created_by, 12 more }
assessment_id: string

Unique identifier for the assessment

assessment_type: AssessmentType

Type of assessment

One of the following:
"comment"
"rating"
"approval"
"rubric"
"metadata"
"overwrite"
created_by: string

User who submitted the assessment

span_id: string

The span this assessment is attached to

trace_id: string

The trace this assessment is attached to

account_id: optional string

Account this assessment belongs to

approval: optional ApprovalStatus

Approval status (approved/rejected)

One of the following:
"approved"
"rejected"
comment: optional string

Raw text feedback

created_at: optional string

When this assessment was created

formatdate-time
metadata: optional map[unknown]

Arbitrary JSON object for additional data

object: optional "span.assessment"
overwrite: optional map[unknown]

User corrections to span output

rating: optional number

Numerical rating (1-5)

maximum5
minimum1
rubric: optional map[string]

Rule key-value pairs for rubric evaluation

updated_at: optional string

When this assessment was last updated

formatdate-time
object: optional "list"

List span or trace assessments

curl https://api.egp.scale.com/v5/span-assessments \
    -H "x-api-key: $SGP_API_KEY"
{
  "items": [
    {
      "assessment_id": "assessment_id",
      "assessment_type": "comment",
      "created_by": "created_by",
      "span_id": "span_id",
      "trace_id": "trace_id",
      "account_id": "account_id",
      "approval": "approved",
      "comment": "comment",
      "created_at": "2019-12-27T18:11:19.117Z",
      "metadata": {
        "foo": "bar"
      },
      "object": "span.assessment",
      "overwrite": {
        "foo": "bar"
      },
      "rating": 1,
      "rubric": {
        "foo": "string"
      },
      "updated_at": "2019-12-27T18:11:19.117Z"
    }
  ],
  "object": "list"
}
Returns Examples
{
  "items": [
    {
      "assessment_id": "assessment_id",
      "assessment_type": "comment",
      "created_by": "created_by",
      "span_id": "span_id",
      "trace_id": "trace_id",
      "account_id": "account_id",
      "approval": "approved",
      "comment": "comment",
      "created_at": "2019-12-27T18:11:19.117Z",
      "metadata": {
        "foo": "bar"
      },
      "object": "span.assessment",
      "overwrite": {
        "foo": "bar"
      },
      "rating": 1,
      "rubric": {
        "foo": "string"
      },
      "updated_at": "2019-12-27T18:11:19.117Z"
    }
  ],
  "object": "list"
}