# Rescore a comparison eval run

POST

/v1/eval-runs/{runId}/rescore

```sh
curl --request POST \
  --url https://example.com/v1/eval-runs/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/rescore \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{ "projectId": "example" }'
```

Starts a new comparison eval run of the same test set version, candidate and settings that replays nothing: it scores the run’s replays again, with the judgments recorded on them since (a changed answer judged on the replay itself; `changes.new` lists the items to judge). The run rescored stays as it was; the new one names it (`comparison.rescoreOf`, `summary.rescoreOf`). A case whose replays can’t be read again keeps its scores (`rescored: false`). Needs `admin` on the run’s suite and `write` on its project.

## Authorizations

- **[bearerAuth](https://docs.kindgi.com/v0.1.8/reference/api.md#bearerauth)**

## Parameters

### Path Parameters

**runId**

required

string format: uuid

EvalRunId — opaque branded UUID.

## Request Body

application/json

Body of `POST /v1/eval-runs/{runId}/rescore`: optional.

object

**projectId**

The run’s project, needed only from a runtime that doesn’t record it on the run.

string

##### Examplegenerated

```json
{
  "projectId": "example"
}
```

## Responses

### 201

The rescore started.

application/json

object

**runId**

required

string format: uuid

**dryRunPreview**

object

**_key_**

additional properties

any

##### Examplegenerated

```json
{
  "runId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0",
  "dryRunPreview": {}
}
```

### 400

`bad-input`: `projectId` is required (this runtime doesn’t record the run’s project), or isn’t a project here. `dispatcher-input-invalid`: this runtime can’t rescore (it doesn’t read replays and their judgments again).

application/json

object

**error**

required

object

**code**

required

Stable machine-readable discriminant. Values match domain error codes (see `docs/API-ROUTE-CONVENTIONS.md` §4.3).

string

**message**

required

string

**details**

Optional, kind-specific.

object

**_key_**

additional properties

any

**requestId**

required

Server-assigned request id; also echoed via `X-Request-Id` header.

string

##### Examplegenerated

```json
{
  "error": {
    "code": "example",
    "message": "example",
    "details": {},
    "requestId": "example"
  }
}
```

### 401

Missing / malformed / expired / revoked bearer token.

application/json

object

**error**

required

object

**code**

required

Stable machine-readable discriminant. Values match domain error codes (see `docs/API-ROUTE-CONVENTIONS.md` §4.3).

string

**message**

required

string

**details**

Optional, kind-specific.

object

**_key_**

additional properties

any

**requestId**

required

Server-assigned request id; also echoed via `X-Request-Id` header.

string

##### Examplegenerated

```json
{
  "error": {
    "code": "example",
    "message": "example",
    "details": {},
    "requestId": "example"
  }
}
```

### 404

No eval run with that id under this tenant.

application/json

object

**error**

required

object

**code**

required

Stable machine-readable discriminant. Values match domain error codes (see `docs/API-ROUTE-CONVENTIONS.md` §4.3).

string

**message**

required

string

**details**

Optional, kind-specific.

object

**_key_**

additional properties

any

**requestId**

required

Server-assigned request id; also echoed via `X-Request-Id` header.

string

##### Examplegenerated

```json
{
  "error": {
    "code": "example",
    "message": "example",
    "details": {},
    "requestId": "example"
  }
}
```

### 409

`eval-run-not-rescorable`: only a completed comparison of a test set can be rescored.

application/json

object

**error**

required

object

**code**

required

Stable machine-readable discriminant. Values match domain error codes (see `docs/API-ROUTE-CONVENTIONS.md` §4.3).

string

**message**

required

string

**details**

Optional, kind-specific.

object

**_key_**

additional properties

any

**requestId**

required

Server-assigned request id; also echoed via `X-Request-Id` header.

string

##### Examplegenerated

```json
{
  "error": {
    "code": "example",
    "message": "example",
    "details": {},
    "requestId": "example"
  }
}
```

### 413

The request body is over the API’s limit (`request-too-large`; `details.maxBytes` says how much).

application/json

object

**error**

required

object

**code**

required

Stable machine-readable discriminant. Values match domain error codes (see `docs/API-ROUTE-CONVENTIONS.md` §4.3).

string

**message**

required

string

**details**

Optional, kind-specific.

object

**_key_**

additional properties

any

**requestId**

required

Server-assigned request id; also echoed via `X-Request-Id` header.

string

##### Examplegenerated

```json
{
  "error": {
    "code": "example",
    "message": "example",
    "details": {},
    "requestId": "example"
  }
}
```

## See also

- [`GET /v1/eval-runs/{runId}`: Fetch an eval run](https://docs.kindgi.com/v0.1.8/reference/api/operations/evalrunsget.md)
- [`POST /v1/eval-runs/{runId}/cancel`: Cancel an eval run](https://docs.kindgi.com/v0.1.8/reference/api/operations/evalrunscancel.md)
- [`GET /v1/eval-runs/{runId}/events`: Stream eval-run events (SSE)](https://docs.kindgi.com/v0.1.8/reference/api/operations/evalrunsevents.md)
- [Error code `bad-input`](https://docs.kindgi.com/v0.1.8/reference/errors.md#bad-input)
- [Error code `dispatcher-input-invalid`](https://docs.kindgi.com/v0.1.8/reference/errors.md#dispatcher-input-invalid)
- [Error code `eval-run-not-rescorable`](https://docs.kindgi.com/v0.1.8/reference/errors.md#eval-run-not-rescorable)
- [Error code `request-too-large`](https://docs.kindgi.com/v0.1.8/reference/errors.md#request-too-large)
- [Every error code](https://docs.kindgi.com/v0.1.8/reference/errors.md)
