Перейти к основному содержимому

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:

ParameterTypeDescription
relationsstringComma-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:

ParameterTypeDescription
pagenumberPage number (1-based)
limitnumberItems per page
whereobjectFilter conditions
relationsarrayRelations 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

ActionPermission Required
Get own profile (/me)Authenticated user
List/find usersORG_USERS_VIEW
Create userORG_USERS_EDIT
Update userORG_USERS_EDIT or self
Delete userORG_USERS_EDIT
Factory resetSUPER_ADMIN