Get a scoring run
Viewing v2— current version
curl --request GET \ --url https://api.app.layer.ai/api/v2/workspaces/:workspace_id/scoring-runs/:scoring_run_id \ --header 'Authorization: Bearer <token>'import requests
url = "https://api.app.layer.ai/api/v2/workspaces/:workspace_id/scoring-runs/:scoring_run_id"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.json())const url = 'https://api.app.layer.ai/api/v2/workspaces/:workspace_id/scoring-runs/:scoring_run_id';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}package main
import ( "fmt" "net/http" "io")
func main() {
url := "https://api.app.layer.ai/api/v2/workspaces/:workspace_id/scoring-runs/:scoring_run_id"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close() body, _ := io.ReadAll(res.Body)
fmt.Println(res) fmt.Println(string(body))
}<?php
$curl = curl_init();
curl_setopt_array($curl, [ CURLOPT_URL => "https://api.app.layer.ai/api/v2/workspaces/:workspace_id/scoring-runs/:scoring_run_id", CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => "", CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 30, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "GET", CURLOPT_HTTPHEADER => [ "Authorization: Bearer <token>" ],]);
$response = curl_exec($curl);$err = curl_error($curl);
curl_close($curl);
if ($err) { echo "cURL Error #:" . $err;} else { echo $response;}OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder() .url("https://api.app.layer.ai/api/v2/workspaces/:workspace_id/scoring-runs/:scoring_run_id") .get() .addHeader("Authorization", "Bearer <token>") .build();
Response response = client.newCall(request).execute();require 'uri'require 'net/http'
url = URI("https://api.app.layer.ai/api/v2/workspaces/:workspace_id/scoring-runs/:scoring_run_id")
http = Net::HTTP.new(url.host, url.port)http.use_ssl = true
request = Net::HTTP::Get.new(url)request["Authorization"] = 'Bearer <token>'
response = http.request(request)puts response.read_bodyvar client = new RestClient("https://api.app.layer.ai/api/v2/workspaces/:workspace_id/scoring-runs/:scoring_run_id");var request = new RestRequest("", Method.Get);request.AddHeader("Authorization", "Bearer <token>");var response = client.Execute(request);Unchanged from v1. This endpoint’s documented request and response schemas are identical in v1 and v2 — change the
/v1prefix 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.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Id of the workspace that owns the resource.
Id of the workspace that owns the resource.
The scoring run id returned when the batch was queued.
The scoring run id returned when the batch was queued.
Responses
Section titled “Responses”Successful Response
object
Unique identifier for this scoring run.
Current status: pending, complete, or failed.
The generation whose outputs this run judged, when it was started automatically.
Suggested polling interval in seconds. Present while pending.
How many (file, rule) pairs the run set out to judge.
How many produced a verdict. Lower than requested means some pairs went unjudged.
The files the run was asked to judge.
The rules the run judged against.
The verdicts recorded. Present once the run is complete.
object
The file this verdict is about.
The scoring rule that produced it.
The rule’s name as it stood when the verdict was recorded.
Score in [0, 100] against that rule.
The judge’s reasoning, in its own words.
When the run settled. Present once terminal.
Error message. Present only on failed.
Machine-readable error code. Present only on failed.
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
The callback URL this run was submitted with.
Pending until a delivery settles, then delivered or failed.
How many delivery attempts have been made.
When the last attempt was made.
HTTP status the receiver returned on the last attempt, if it responded.
Why the last attempt did not succeed. Null once delivered.
Example
{ "status": "pending", "file_ids": [], "rule_ids": [], "scores": [ { "rationale": "" } ], "webhook": { "status": "pending" }}Unauthenticated — missing or invalid Bearer token.
object
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.
object
Example
{ "type": "https://api.layer.ai/errors/ERROR_CODE", "title": "Error Title", "status": 400, "detail": "Human-readable description."}Resource not found.
object
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.
object
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.
object
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.
object
Example
{ "type": "https://api.layer.ai/errors/ERROR_CODE", "title": "Error Title", "status": 400, "detail": "Human-readable description."}Internal server error.
object
Example
{ "type": "https://api.layer.ai/errors/ERROR_CODE", "title": "Error Title", "status": 400, "detail": "Human-readable description."}