MATIH Platform is in active MVP development. Documentation reflects current implementation status.
6. Identity & Access Management
User Endpoints

User Endpoints

The user management endpoints provide CRUD operations for user accounts, role assignment, account state management, and password operations. All endpoints require authentication and most require ADMIN or PLATFORM_ADMIN roles. Served by UserController at /api/v1/users.


Endpoints

MethodEndpointDescriptionRole
POST/api/v1/usersCreate userAdmin
GET/api/v1/users/:userIdGet user by IDAdmin
GET/api/v1/users/meGet current userAny
GET/api/v1/usersList users (paginated)Admin
PUT/api/v1/users/:userIdUpdate userAdmin
PUT/api/v1/users/meUpdate current userAny
PUT/api/v1/users/:userId/rolesUpdate user rolesAdmin
PUT/api/v1/users/:userId/enableEnable user accountAdmin
PUT/api/v1/users/:userId/disableDisable user accountAdmin
PUT/api/v1/users/:userId/unlockUnlock locked accountAdmin
DELETE/api/v1/users/:userIdDelete userAdmin
POST/api/v1/users/me/passwordChange own passwordAny
POST/api/v1/users/:userId/reset-passwordAdmin reset passwordAdmin

POST /api/v1/users

Creates a new user account within the tenant.

Headers: X-Tenant-ID (required)

{
  "email": "new.user@example.com",
  "firstName": "John",
  "lastName": "Doe",
  "password": "initialPassword123",
  "roleIds": [1, 2]
}
StatusDescription
201User created, returns UserResponse
400Invalid request or email already exists

GET /api/v1/users

Returns a paginated list of users. Supports search by name or email.

Query Parameters:

ParameterTypeDescription
searchstringFilter by name or email
pageintPage number (default: 0)
sizeintPage size (default: 20)

GET /api/v1/users/me

Returns the profile of the currently authenticated user. Does not require admin privileges.


PUT /api/v1/users/:userId/roles

Replaces all roles assigned to a user.

[1, 3, 5]

The request body is an array of role IDs. Returns the updated UserResponse.


Account State Operations

EndpointEffect
PUT /api/v1/users/:userId/enableSets account to enabled state
PUT /api/v1/users/:userId/disableSets account to disabled state (blocks login)
PUT /api/v1/users/:userId/unlockResets failed login counter and unlocks the account

Password Operations

Change own password (POST /api/v1/users/me/password):

{
  "currentPassword": "oldPassword",
  "newPassword": "newSecurePassword123"
}

Admin reset (POST /api/v1/users/:userId/reset-password): Returns a temporaryPassword that the user must change on next login.