User Endpoints
Manage user accounts, profiles, preferences, and user-organization associations.
Base Pathโ
/api/user
Endpointsโ
Get Current User (Me)โ
Retrieves the currently authenticated user's profile.
GET /api/user/me
Authorization: Bearer {token}
Query Parameters:
| Parameter | Type | Description |
|---|---|---|
relations | string | Comma-separated relations to include (e.g., role,tenant,employee) |
Allowed Relations: role, tenant, employee, candidate, tags
Response 200 OK:
{
"id": "uuid",
"email": "user@example.com",
"firstName": "John",
"lastName": "Doe",
"imageUrl": "https://...",
"preferredLanguage": "en",
"preferredComponentLayout": "TABLE",
"role": { "id": "uuid", "name": "ADMIN" },
"tenant": { "id": "uuid", "name": "My Company" },
"employee": { "id": "uuid" }
}
Find User by Emailโ
GET /api/user/email/:email
Authorization: Bearer {token}
List Users (Paginated)โ
GET /api/user/pagination
Authorization: Bearer {token}
Query Parameters:
| Parameter | Type | Description |
|---|---|---|
page | number | Page number (1-based) |
limit | number | Items per page |
where | object | Filter conditions |
relations | array | Relations to include |
Find All Usersโ
GET /api/user
Authorization: Bearer {token}
Find User by IDโ
GET /api/user/:id
Authorization: Bearer {token}
Get User Countโ
GET /api/user/count
Authorization: Bearer {token}
Create Userโ
POST /api/user
Authorization: Bearer {token}
Content-Type: application/json
{
"email": "newuser@example.com",
"firstName": "Jane",
"lastName": "Doe",
"roleId": "uuid",
"hash": "password_hash"
}
Response 201 Created.
Update Userโ
PUT /api/user/:id
Authorization: Bearer {token}
Content-Type: application/json
{
"firstName": "Updated Name",
"imageUrl": "https://new-avatar.png"
}
Update Preferred Languageโ
PUT /api/user/preferred-language
Authorization: Bearer {token}
Content-Type: application/json
{
"preferredLanguage": "fr"
}
Update Preferred Component Layoutโ
PUT /api/user/preferred-component-layout
Authorization: Bearer {token}
Content-Type: application/json
{
"preferredComponentLayout": "CARDS_GRID"
}
Available layouts: TABLE, CARDS_GRID, SPRINT_VIEW
Delete Userโ
DELETE /api/user/:id
Authorization: Bearer {token}
Response 200 OK.
Factory Resetโ
Resets the entire system to its initial state. Requires SUPER_ADMIN role.
GET /api/user/reset
Authorization: Bearer {token}
โ ๏ธ Warning: This removes all data and re-seeds the database. Use with extreme caution.
Data Modelโ
interface IUser {
id: string;
email: string;
firstName?: string;
lastName?: string;
hash?: string;
imageUrl?: string;
preferredLanguage?: string;
preferredComponentLayout?: ComponentLayoutStyleEnum;
thirdPartyId?: string;
// Relations
roleId?: string;
role?: IRole;
tenantId?: string;
tenant?: ITenant;
employee?: IEmployee;
candidate?: ICandidate;
tags?: ITag[];
}
Permissionsโ
| Action | Permission Required |
|---|---|
Get own profile (/me) | Authenticated user |
| List/find users | ORG_USERS_VIEW |
| Create user | ORG_USERS_EDIT |
| Update user | ORG_USERS_EDIT or self |
| Delete user | ORG_USERS_EDIT |
| Factory reset | SUPER_ADMIN |
Related Pagesโ
- Authentication Endpoints โ login and registration
- Employee Endpoints โ employee management
- Role & Permission Endpoints โ role management