Skip to main content
POST
/
projects
/
{projectId}
/
runs
JavaScript
import Scorecard from 'scorecard-ai';

const client = new Scorecard({
  apiKey: 'My API Key',
});

const run = await client.runs.create('314', {
  metricIds: ['789', '101'],
  systemVersionId: '87654321-4d3b-4ae4-8c7a-4b6e2a19ccf0',
  testsetId: '246',
});

console.log(run.id);
{
"id": "135",
"testsetId": "246",
"systemId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"systemVersionId": "87654321-4d3b-4ae4-8c7a-4b6e2a19ccf0",
"metricIds": [
"789",
"101"
],
"metricVersionIds": [
"87654321-4d3b-4ae4-8c7a-4b6e2a19ccf0",
"87654321-4d3b-4ae4-8c7a-4b6e2a19ccf1"
],
"numRecords": 0,
"numExpectedRecords": 10,
"numScores": 0,
"status": "awaiting_execution"
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

projectId
string
required

The ID of the Project.

Example:

"314"

Body

application/json
metricIds
string[]
required

The IDs of the metrics this Run is using.

testsetId
string | null

The ID of the Testset this Run is testing.

systemVersionId
string<uuid> | null

The ID of the system version this Run is using.

Response

Run created successfully

A Run in the Scorecard system.

id
string
required

The ID of the Run.

testsetId
string | null
required

The ID of the Testset this Run is testing.

systemId
string<uuid> | null
required

The ID of the system this Run is using.

systemVersionId
string<uuid> | null
required

The ID of the system version this Run is using.

metricIds
string[]
required

The IDs of the metrics this Run is using.

metricVersionIds
string<uuid>[]
required

The IDs of the metric versions this Run is using.

numRecords
number
required

The number of records in the Run.

numExpectedRecords
number | null
required

The number of expected records in the Run. Determined by the number of testcases in the Run's Testset at the time of Run creation.

numScores
number
required

The number of completed scores in the Run so far.

status
enum<string>
required

The status of the Run.

Available options:
pending,
awaiting_execution,
running_execution,
awaiting_scoring,
running_scoring,
awaiting_human_scoring,
completed
I