# Get a project's uptime report

`GET /api/v1/projects/{projectId}/sla`

The uptime report of every check of the project, by name, and their total.

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_project_sla`.

## Parameters

| Name | In | Required | Type | Description |
|---|---|---|---|---|
| `projectId` | path | yes | string (uuid) | The project's id. |
| `month` | query | no | string | `YYYY-MM`: the calendar month in the workspace timezone. Without `month`, `from` and `to`, the current month. |
| `from` | query | no | string | RFC 3339, together with `to`; not with `month`. |
| `to` | query | no | string | RFC 3339, together with `from`; at most 367 days after it. |

## Responses

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

### 200

The report.

`application/json`: SlaReport

| Field | Type | Required | Description |
|---|---|---|---|
| `checks` | array of CheckSla | yes | One row per check, by name; for a check report only that check. |
| `from` | string | yes |  |
| `measuredTo` | string | yes | Time after this (now, when the range reaches into the future) is not measured yet. |
| `projectId` | string (uuid) | yes |  |
| `timezone` | string | yes | The workspace timezone the month was taken in. |
| `to` | string | yes |  |
| `total` | SlaTotals | yes | For a check report equal to its row. |

### 400

Bad Request.

- `request.malformed`: the body or a parameter is not of the expected shape
- `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
- `request.invalid_range`: `from` is not earlier than `to`

### 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).
