# Get response times

`GET /api/v1/checks/{checkId}/latency`

Response time per location over a range, as average and 95th percentile per bucket. The bucket follows from the range: raw results up to 6 hours, 5 minutes up to 7 days, an hour up to 90 days, a day beyond, and at most 1000 points per location. Intervals a location has no data for are listed in `noData`.

Sign-in: a dashboard session, an API token with `checks:read` or the `monitorly` CLI's sign-in with `checks:read`.

Section: Checks. Operation id in openapi.json: `get_check_latency`.

## Parameters

| Name | In | Required | Type | Description |
|---|---|---|---|---|
| `checkId` | path | yes | string (uuid) | The check's id. |
| `from` | query | no | string | RFC 3339; default 24 h before `to`. |
| `to` | query | no | string | RFC 3339; default now. |
| `nodeId` | query | no | string (uuid) | Only this node's results. |
| `cursor` | query | no | string | Ignored: response times are not paged. |
| `limit` | query | no | integer | Ignored: response times are not paged. |

## Responses

Errors are `application/problem+json` (`Problem`); branch on `type`.

### 200

The series per location.

`application/json`: Latency

| Field | Type | Required | Description |
|---|---|---|---|
| `bucketSecs` | integer | yes |  |
| `from` | string | yes |  |
| `noData` | array of NoDataSpan | yes | "No data" intervals overlapping the range, oldest first; at most 1000, the newest kept. |
| `noDataTruncated` | boolean | yes | More intervals overlap the range than `noData` carries. |
| `nodes` | array of NodeRef | yes | The nodes of `series` and `noData`, revoked ones included. |
| `resolution` | Resolution | yes |  |
| `series` | array of LatencySeries | yes |  |
| `to` | string | yes |  |

### 400

Bad Request.

- `request.malformed`: the body or a parameter is not of the expected shape
- `request.invalid_cursor`: the cursor is not one this list gave
- `auth.credentials_conflict`: the request carries both a session cookie and a token

### 401

Unauthorized.

- `auth.unauthenticated`, `auth.session_expired`: no session, or it ended
- `token.invalid`: the token is malformed, unknown, revoked or expired, or its creator left the workspace

### 403

Forbidden.

- `auth.forbidden`: your role is too low for this
- `token.scope_missing`: the token lacks the scope this needs; `detail` names it

### 404

Not Found.

- `request.not_found`: it does not exist, or you cannot see it

### 422

Unprocessable Entity.

- `field.invalid`, `field.required`: a parameter breaks a rule; `errors` points at it

### 429

Too Many Requests.

- `token.rate_limited`: more than 10 requests a second with this token

Schemas named above are listed with their fields in [the schema list](https://docs.monitorly.cloud/api/reference/schemas.md).
