Skip to content

Get a scoring run

Viewing v2— current version

GET
/v2/workspaces/{workspace_id}/scoring-runs/{scoring_run_id}
curl --request GET \
--url https://api.app.layer.ai/api/v2/workspaces/:workspace_id/scoring-runs/:scoring_run_id \
--header 'Authorization: Bearer <token>'

Unchanged from v1. This endpoint’s documented request and response schemas are identical in v1 and v2 — change the /v1 prefix to /v2. Schema equality is not a promise about behaviour, so keep your usual smoke tests.

The status of one batch of scoring work, and its verdicts once it is complete.

completed_pair_count below requested_pair_count on a complete run means some pairs went unjudged — an asset a judge could not read, say. That is a gap, not a failure: a failed run is one that never got to judge anything.

workspace_id
required
Workspace Id

Id of the workspace that owns the resource.

string format: uuid

Id of the workspace that owns the resource.

scoring_run_id
required
Scoring Run Id

The scoring run id returned when the batch was queued.

string format: uuid

The scoring run id returned when the batch was queued.

Successful Response

Media typeapplication/json
GetScoringRunOutput
object
scoring_run_id
required
Scoring Run Id

Unique identifier for this scoring run.

string format: uuid
status
required
ScoringRunStatus

Current status: pending, complete, or failed.

string
Allowed values: pending complete failed
inference_id
Inference Id

The generation whose outputs this run judged, when it was started automatically.

string format: uuid
nullable
poll_interval_seconds
Poll Interval Seconds

Suggested polling interval in seconds. Present while pending.

integer
nullable
requested_pair_count
required
Requested Pair Count

How many (file, rule) pairs the run set out to judge.

integer
completed_pair_count
required
Completed Pair Count

How many produced a verdict. Lower than requested means some pairs went unjudged.

integer
file_ids
File Ids

The files the run was asked to judge.

Array<string>
default:
rule_ids
Rule Ids

The rules the run judged against.

Array<string>
default:
scores
Scores

The verdicts recorded. Present once the run is complete.

Array<object>
nullable
ScoringRunFileScore
object
file_id
required
File Id

The file this verdict is about.

string format: uuid
rule_id
required
Rule Id

The scoring rule that produced it.

string format: uuid
rule_name
required
Rule Name

The rule’s name as it stood when the verdict was recorded.

string
score
required
Score

Score in [0, 100] against that rule.

integer
rationale
Rationale

The judge’s reasoning, in its own words.

string
""
finished_at
Finished At

When the run settled. Present once terminal.

string format: date-time
nullable
error
Error

Error message. Present only on failed.

string
nullable
error_code
Error Code

Machine-readable error code. Present only on failed.

string
nullable
webhook
Any of:
WebhookStatusView

What a job’s GET reports about the callback attached to it.

The URL is echoed so a caller can tell which of its endpoints a run was aimed at; the rest is how the delivery went, which is the only place a failed delivery is visible.

object
url
required
Url

The callback URL this run was submitted with.

string
status
required
WebhookDeliveryStatus

Pending until a delivery settles, then delivered or failed.

string
Allowed values: pending delivered failed
attempts
required
Attempts

How many delivery attempts have been made.

integer
last_attempt_at
Last Attempt At

When the last attempt was made.

string format: date-time
nullable
last_response_status
Last Response Status

HTTP status the receiver returned on the last attempt, if it responded.

integer
nullable
last_error
Last Error

Why the last attempt did not succeed. Null once delivered.

string
nullable
Example
{
"status": "pending",
"file_ids": [],
"rule_ids": [],
"scores": [
{
"rationale": ""
}
],
"webhook": {
"status": "pending"
}
}

Unauthenticated — missing or invalid Bearer token.

Media typeapplication/problem+json
object
type
required
string
title
required
string
status
required
integer
detail
required
string
Example
{
"type": "https://api.layer.ai/errors/ERROR_CODE",
"title": "Error Title",
"status": 400,
"detail": "Human-readable description."
}

Forbidden — insufficient permissions, or the access token lacks the scope the operation requires.

Media typeapplication/problem+json
object
type
required
string
title
required
string
status
required
integer
detail
required
string
Example
{
"type": "https://api.layer.ai/errors/ERROR_CODE",
"title": "Error Title",
"status": 400,
"detail": "Human-readable description."
}

Resource not found.

Media typeapplication/problem+json
object
type
required
string
title
required
string
status
required
integer
detail
required
string
Example
{
"type": "https://api.layer.ai/errors/ERROR_CODE",
"title": "Error Title",
"status": 400,
"detail": "Human-readable description."
}

The outcome of the request with this Idempotency-Key is not known yet: it is still running, or it failed without a stored response. Retry after the number of seconds in Retry-After.

Media typeapplication/problem+json
object
type
required
string
title
required
string
status
required
integer
detail
required
string
Example
{
"type": "https://api.layer.ai/errors/ERROR_CODE",
"title": "Error Title",
"status": 400,
"detail": "Human-readable description."
}

Invalid input parameters, or an Idempotency-Key reused for a different request.

Media typeapplication/problem+json
object
type
required
string
title
required
string
status
required
integer
detail
required
string
Example
{
"type": "https://api.layer.ai/errors/ERROR_CODE",
"title": "Error Title",
"status": 400,
"detail": "Human-readable description."
}

Rate limited — retry after the number of seconds in Retry-After.

Media typeapplication/problem+json
object
type
required
string
title
required
string
status
required
integer
detail
required
string
Example
{
"type": "https://api.layer.ai/errors/ERROR_CODE",
"title": "Error Title",
"status": 400,
"detail": "Human-readable description."
}

Internal server error.

Media typeapplication/problem+json
object
type
required
string
title
required
string
status
required
integer
detail
required
string
Example
{
"type": "https://api.layer.ai/errors/ERROR_CODE",
"title": "Error Title",
"status": 400,
"detail": "Human-readable description."
}