# Get a scoring run

GET

/v2/workspaces/{workspace\_id}/scoring-runs/{scoring\_run\_id}

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

```python
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())
```

```js
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);
}
```

```go
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
<?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;
}
```

```java
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();
```

```ruby
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_body
```

```csharp
var 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);
```

* Layer API

> **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.

## Authorizations

* **[bearerAuth](/docs/v2/rest-api#bearerauth)**
* **[oauth2](/docs/v2/rest-api#oauth2)**
* **[serviceAccount](/docs/v2/rest-api#serviceaccount)**  
projects:read

## Parameters

### Path Parameters

**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.

## Responses

### 200

Successful Response

_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**

_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

**null**

null

##### Example

```json
{
  "status": "pending",
  "file_ids": [],
  "rule_ids": [],
  "scores": [
    {
      "rationale": ""
    }
  ],
  "webhook": {
    "status": "pending"
  }
}
```

### 401

Unauthenticated — missing or invalid Bearer token.

object

**type**

required

string

**title**

required

string

**status**

required

integer

**detail**

required

string

##### Example

```json
{
  "type": "https://api.layer.ai/errors/ERROR_CODE",
  "title": "Error Title",
  "status": 400,
  "detail": "Human-readable description."
}
```

### 403

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

object

**type**

required

string

**title**

required

string

**status**

required

integer

**detail**

required

string

##### Example

```json
{
  "type": "https://api.layer.ai/errors/ERROR_CODE",
  "title": "Error Title",
  "status": 400,
  "detail": "Human-readable description."
}
```

### 404

Resource not found.

object

**type**

required

string

**title**

required

string

**status**

required

integer

**detail**

required

string

##### Example

```json
{
  "type": "https://api.layer.ai/errors/ERROR_CODE",
  "title": "Error Title",
  "status": 400,
  "detail": "Human-readable description."
}
```

### 409

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

**type**

required

string

**title**

required

string

**status**

required

integer

**detail**

required

string

##### Example

```json
{
  "type": "https://api.layer.ai/errors/ERROR_CODE",
  "title": "Error Title",
  "status": 400,
  "detail": "Human-readable description."
}
```

### 422

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

object

**type**

required

string

**title**

required

string

**status**

required

integer

**detail**

required

string

##### Example

```json
{
  "type": "https://api.layer.ai/errors/ERROR_CODE",
  "title": "Error Title",
  "status": 400,
  "detail": "Human-readable description."
}
```

### 429

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

object

**type**

required

string

**title**

required

string

**status**

required

integer

**detail**

required

string

##### Example

```json
{
  "type": "https://api.layer.ai/errors/ERROR_CODE",
  "title": "Error Title",
  "status": 400,
  "detail": "Human-readable description."
}
```

### 500

Internal server error.

object

**type**

required

string

**title**

required

string

**status**

required

integer

**detail**

required

string

##### Example

```json
{
  "type": "https://api.layer.ai/errors/ERROR_CODE",
  "title": "Error Title",
  "status": 400,
  "detail": "Human-readable description."
}
```
