# Get the session

`GET /api/v1/auth/session`

The signed-in person and their workspaces. A pending sign-in answers `auth.totp_required`.

Sign-in: a dashboard session only. API tokens and OAuth sign-ins get `403 token.not_allowed`.

Section: Sign-in and account. Operation id in openapi.json: `get_session`.

## Responses

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

### 200

The session.

`application/json`: SessionView

| Field | Type | Required | Description |
|---|---|---|---|
| `user` | UserView | yes |  |
| `workspaces` | array of WorkspaceSummary | yes |  |

### 400

Bad Request.

- `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
- `auth.totp_required`: password accepted, TOTP code required
- `auth.session_expired`: session expired (7 days idle or 30 days since sign-in)

### 403

Forbidden.

- `auth.forbidden`: your role is too low for this
- `token.not_allowed`: this operation needs a signed-in session; tokens cannot call it

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