Skip to content

List and filter evaluation items

client.EvaluationItems.List(ctx, query) (*CursorPage[EvaluationItem], error)
GET/v5/evaluation-items

Return a paginated list of evaluation items belonging to the caller’s account.

Pass evaluation_id to restrict the results to a single evaluation’s items. The completion_status filter selects items by whether any of their tasks errored: failed returns only items that have task errors, passed returns only items with no task errors, and all (or omitting the parameter) returns every item. Archived items are excluded unless include_archived=true. Each returned item has its cached task results merged into data and its errors exposed in task_errors, identically to the single-item endpoint.

ParametersExpand Collapse
query EvaluationItemListParams
CompletionStatus param.Field[EvaluationItemListParamsCompletionStatus]Optional

Filter items by completion status. Pass ‘failed’ to return only items with errors, ‘passed’ for items without errors. Pass ‘all’ or omit to return all items.

const EvaluationItemListParamsCompletionStatusFailed EvaluationItemListParamsCompletionStatus = "failed"
const EvaluationItemListParamsCompletionStatusPassed EvaluationItemListParamsCompletionStatus = "passed"
const EvaluationItemListParamsCompletionStatusAll EvaluationItemListParamsCompletionStatus = "all"
EndingBefore param.Field[string]Optional
EvaluationID param.Field[string]Optional
IncludeArchived param.Field[bool]Optional
Limit param.Field[int64]Optional
maximum10000
minimum1
SortBy param.Field[string]Optional
SortOrder param.Field[SortOrder]Optional
StartingAfter param.Field[string]Optional
ReturnsExpand Collapse
type EvaluationItem struct{…}
ID string

The unique identifier of the entity.

CreatedAt Time

The date and time when the entity was created in ISO format.

formatdate-time
CreatedBy Identity

The identity that created the entity.

ID string
Type IdentityType
One of the following:
const IdentityTypeUser IdentityType = "user"
const IdentityTypeServiceAccount IdentityType = "service_account"
Object IdentityObjectOptional
Data map[string, any]
EvaluationID string
ArchivedAt TimeOptional

The date and time when the entity was archived in ISO format.

formatdate-time
DatasetItemID stringOptional
DatasetItemVersionNum int64Optional
Files map[string, string]Optional
Object EvaluationItemObjectOptional
TaskErrors map[string, TaskError]Optional

Map of task alias to error info.

Message string

Error message

Type string

Error type/category

TaskResultStatuses map[string, string]Optional

Per-alias task-result lifecycle status derived from task_result_cache. Present when at least one alias has a recorded status; null for legacy rows with an empty cache. Renderers use this to distinguish prefilled from completed on the wire (values themselves are already merged into data by merge_task_result_cache_into_data).

One of the following:
const EvaluationItemTaskResultStatusCompleted EvaluationItemTaskResultStatus = "completed"
const EvaluationItemTaskResultStatusSkipped EvaluationItemTaskResultStatus = "skipped"
const EvaluationItemTaskResultStatusErrored EvaluationItemTaskResultStatus = "errored"
const EvaluationItemTaskResultStatusPending EvaluationItemTaskResultStatus = "pending"
const EvaluationItemTaskResultStatusPrefilled EvaluationItemTaskResultStatus = "prefilled"

List and filter evaluation items

package main

import (
  "context"
  "fmt"

  "github.com/scaleapi/sgp-dev-go"
  "github.com/scaleapi/sgp-dev-go/option"
)

func main() {
  client := sgpdev.NewClient(
    option.WithAPIKey("My API Key"),
    option.WithAccountID("My Account ID"),
  )
  page, err := client.EvaluationItems.List(context.TODO(), sgpdev.EvaluationItemListParams{

  })
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", page)
}
{
  "has_more": true,
  "items": [
    {
      "id": "id",
      "created_at": "2019-12-27T18:11:19.117Z",
      "created_by": {
        "id": "id",
        "type": "user",
        "object": "identity"
      },
      "data": {
        "foo": "bar"
      },
      "evaluation_id": "evaluation_id",
      "archived_at": "2019-12-27T18:11:19.117Z",
      "dataset_item_id": "dataset_item_id",
      "dataset_item_version_num": 0,
      "files": {
        "foo": "string"
      },
      "object": "evaluation.item",
      "task_errors": {
        "foo": {
          "message": "message",
          "type": "type"
        }
      },
      "task_result_statuses": {
        "foo": "completed"
      }
    }
  ],
  "total": 0,
  "limit": 0,
  "object": "list"
}
Returns Examples
{
  "has_more": true,
  "items": [
    {
      "id": "id",
      "created_at": "2019-12-27T18:11:19.117Z",
      "created_by": {
        "id": "id",
        "type": "user",
        "object": "identity"
      },
      "data": {
        "foo": "bar"
      },
      "evaluation_id": "evaluation_id",
      "archived_at": "2019-12-27T18:11:19.117Z",
      "dataset_item_id": "dataset_item_id",
      "dataset_item_version_num": 0,
      "files": {
        "foo": "string"
      },
      "object": "evaluation.item",
      "task_errors": {
        "foo": {
          "message": "message",
          "type": "type"
        }
      },
      "task_result_statuses": {
        "foo": "completed"
      }
    }
  ],
  "total": 0,
  "limit": 0,
  "object": "list"
}