<!-- https://developers.silktide.com/v1/governance/checks/get-checks | Governance / Checks -->

# List a website's checks and how each is doing

`GET /v1/results/checks`

Returns every check a website or one of its sections is tested with, and
where each stands now: open or done, how many issues, its score.

Filter by `confidence` to see only what is certain (`error`) or only what
needs a person to look (`review`). `checkType` is the older filter and still
works; `confidence` wins when both are sent.

Use a check's id with [Get check](https://developers.silktide.com/v1/governance/checks/get-check.md) for its
history.

## Request

### Query parameters

- `websiteId` (integer, required, at least 1): The website.
- `sectionId` (integer, optional): A section of the website. Defaults to `0`, the whole website.
- `confidence` (string, optional): Only checks of these confidences, comma-separated: `error`, `warning`, `review`.
- `checkType` (string, optional): Only checks of these older types, comma-separated: `auto` or `assist`. Ignored when `confidence` is sent.
- `isPolicy` (string, optional): `1` for only checks from policies, `0` for only Silktide's own. Left out, both. One of: `0`, `1`.

## Response

Status `200`.

- `result` (object, required): The answer.
  - `checks` (list of objects, required): Every check the website or section is tested with.
    - `checkId` (string, required): The check's id, such as `broken-links`. Use it with Get check.
    - `checkerId` (string, required): The internal name of the code that runs the check, such as `Links/BrokenLinks`.
    - `name` (string, required): What the check asks for, in the API user's language.
    - `subName` (string, required): The standard it tests against, such as `WCAG 2.0 A 1.3.1`. Can be empty.
    - `shortName` (string, required): A short name for the check.
    - `policyId` (integer, required): The policy the check comes from, or `0` for Silktide's own checks.
    - `checkType` (string, required): The older classification: `auto` (automatic), `assist` (needs a person's judgment), `info`, or empty.
    - `confidence` (string, required): How sure Silktide is of an issue: `error`, `warning` or `review`. Can be `info` or empty for older checks.
    - `status` (string, required): `open` when it has something to fix, `done` when it does not. One of: `open`, `done`.
    - `severity` (number, required, 0 to 100): How much its issues matter, from 0 to 100.
    - `opened` (integer, required): When it was opened. `0` if it never was.
    - `closed` (integer, required): When it was closed. `0` if it is not.
    - `numIssues` (integer, required): How many issues it found.
    - `score` (number, required, can be null, 0 to 100): Its score out of 100. Null when it cannot be scored.
- `selector` (string, required): The query that answered, as its path: `/v1/results/scores`.
- `duration` (number, required): Seconds Silktide took to answer.

## Errors

| Status | Type | When |
| --- | --- | --- |
| 404 | `ModelNotFound` | No website or section with that id exists in the account, or the API key's user cannot see it. |
| 200 | `InvalidContext` | No `websiteId` was sent. The body is an error despite the status. |
| 401 | `NotLoggedIn` | No API key was sent, or it is not a key for this region. |
| 429 | `TooManyRequests` | Too many requests to this path in five seconds. Retry after the number of seconds in the `Retry-After` header, which `properties.retryAfter` repeats. |
| 503 | - | Silktide is busy. Retry after the number of seconds in the `Retry-After` header. |

## Access

- Permission: any user of the account
- Plan feature: none
- Edition: Silktide 4 and Silktide 5
- Cost: free
- Stability: stable, since 1.0.0

## Example: Every check on a website

```bash
curl "https://api.eu.silktide.com/v1/results/checks?websiteId=3" \
  -H "Authorization: silktide token=$SILKTIDE_API_KEY"
```

Response:

```json
{
  "result": {
    "checks": [
      {
        "checkId": "broken-links",
        "checkerId": "Links/BrokenLinks",
        "name": "Check and fix broken links",
        "subName": "",
        "shortName": "Broken links",
        "policyId": 0,
        "checkType": "auto",
        "confidence": "error",
        "status": "open",
        "severity": 77.625,
        "opened": 1790224865,
        "closed": 0,
        "numIssues": 4,
        "score": 82.5
      },
      {
        "checkId": "accessibility-overlay",
        "checkerId": "Accessibility/AccessibilityOverlay",
        "name": "Avoid relying on a third-party accessibility overlay",
        "subName": "",
        "shortName": "Accessibility overlay",
        "policyId": 0,
        "checkType": "",
        "confidence": "error",
        "status": "done",
        "severity": 0,
        "opened": 0,
        "closed": 0,
        "numIssues": 0,
        "score": 100
      }
    ]
  },
  "selector": "/v1/results/checks",
  "duration": 0.04
}
```
