---
title: "Get User State (v2)"
method: GET
path: "/v2/users/{id}/state"
tags: ["Users State"]
---

# Get User State (v2)

`GET /v2/users/{id}/state`

## Request

- The document declares no server URL.
- Auth: none declared. Required headers: `X-New-Login`

Returns the authenticated user's state (v2). The path ID must be `0`; any non-zero value is rejected. V2 payload includes `domains`, optional `fines`, and `business_unit_users`.

## Path parameters

- `id` integer, required

## Headers

- `X-New-Login` boolean, required

## Response `200`

Successful retrieval of user state (v2)

- UserStateResponseV2
  - `cache_name` string, required: The cache key that the user state has been stored under.
  - `user_id` integer, required: users.user_id
  - `username` string, required: users.username
  - `name` string: Obtained from access token until persisted in DB (applies when id = 0).
  - `status` 'PENDING' | 'ACTIVE' | 'SUSPENDED' | 'DEACTIVATED', required: Derived user status.
  - `version` integer, required: users.version
  - `domains` Domains, required
    - `fines` Domain, required: Domain object
      - `business_unit_users` BusinessUnitUser[], required
        - `business_unit_id` integer: Business unit identifier.
        - `business_unit_name` string: Human readable name of the business unit.
        - `roles` string[]

## Other responses

- `400`: Invalid request (for example, non-zero user id)
- `404`: User not found

## Changes

- **2026-06-02** `8822a9c28d61`: 1 breaking, 2 warning, 19 info
  - the `domains/fines/business_unit_users/items/` response's property type changed from no type to `object` for status `200`
  - for the `path` request parameter `id`, the max was set to `0.00`
  - for the `path` request parameter `id`, the min was set to `0.00`
  - added the optional property `domains/fines/business_unit_users/items/business_unit_id` to the response with the `200` status
  - …18 more

[Operation history](https://skmtc.dev/hm-courts-and-tribunals-service/apis/opal-user-service-user-state/changes/v2/users/:id/state/get.md)

---

[API](https://skmtc.dev/hm-courts-and-tribunals-service/apis/opal-user-service-user-state.md) - [All operations](https://skmtc.dev/hm-courts-and-tribunals-service/apis/opal-user-service-user-state/llms.txt) - [OpenAPI document](https://skmtc.dev/hm-courts-and-tribunals-service/apis/opal-user-service-user-state/revisions/8822a9c28d61?raw)
