# What a rule would have queued

GET

/v1/projects/{projectId}/judging-rules/preview

```sh
curl --request GET \
  --url https://example.com/v1/projects/example/judging-rules/preview \
  --header 'Authorization: Bearer <token>'
```

Among the project’s last `last` top-level runs (not replays), how many a rule with these fields (and its `sample`) would have queued. The rule editor’s “would have added N of the last 100”. Lists are comma-separated. Needs `read` on the project.

## Authorizations

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

## Parameters

### Path Parameters

**projectId**

required

string

ProjectId — opaque branded string.

### Query Parameters

**agentIds**

string

Comma-separated.

**flowIds**

string

Comma-separated.

**versions**

string

Comma-separated; `live` for the live version.

**status**

string

Comma-separated: completed, failed, cancelled.

**includeDryRuns**

boolean

`true` to count dry runs.

**sample**

number

0 < sample ≤ 1. Default 1.

**last**

integer

\>= 1 <= 500

How many recent runs to look at, 1 to 500. Default 100.

**ruleId**

string

An existing rule’s id, to sample as that rule does: `matched` is then exactly the runs it would take. Without it, `matched` is an estimate.

## Responses

### 200

The preview.

application/json

object

**considered**

required

The recent runs looked at.

integer

**matched**

required

Those the rule would have queued, with its `sample` (`maxOpen` isn’t applied).

integer

##### Examplegenerated

```json
{
  "considered": 1,
  "matched": 1
}
```

### 400

A malformed field (`bad-input`).

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 project with that id (`project-not-found`).

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/projects/{projectId}`: Fetch a project by id](https://docs.kindgi.com/v0.1.10/reference/api/operations/projectsget.md)
- [`PATCH /v1/projects/{projectId}`: Partially update a project](https://docs.kindgi.com/v0.1.10/reference/api/operations/projectsupdate.md)
- [`DELETE /v1/projects/{projectId}`: Delete a project (idempotent)](https://docs.kindgi.com/v0.1.10/reference/api/operations/projectsdelete.md)
- [`GET /v1/projects/{projectId}/judging-rules`: List a project's judging rules](https://docs.kindgi.com/v0.1.10/reference/api/operations/projectsjudgingruleslist.md)
- [Error code `bad-input`](https://docs.kindgi.com/v0.1.10/reference/errors.md#bad-input)
- [Error code `project-not-found`](https://docs.kindgi.com/v0.1.10/reference/errors.md#project-not-found)
- [Every error code](https://docs.kindgi.com/v0.1.10/reference/errors.md)
