The Users API is the entry point for provisioning human identities inside KaroKar. Every person who interacts with the platform — whether an internal employee, a fleet administrator, or a corporate contact — must first be registered as aDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/Codefied-CodePix/Karokar-backend/llms.txt
Use this file to discover all available pages before exploring further.
User. User records are intentionally lightweight: they store only core identity fields and rely on the Organizations API membership model to grant roles and context. All endpoints sit behind the PermissionGuard; a valid Authorization bearer token is required on every call.
POST /users
Creates a new user account in the platform. Required permission:employee.manage
Only principals whose JWT contains the
employee.manage permission may create users. Attempting this call with a token that lacks the permission returns 403 Forbidden.Request body
The user’s given name. Must be a non-empty string.
The user’s family name. Must be a non-empty string.
A valid, unique email address. Validated with
@IsEmail(). Duplicate email values will be rejected at the database level.Optional contact phone number. Any string format is accepted; normalisation is the caller’s responsibility.
Response
Returns the newly createdUser object.
UUID primary key, auto-generated.
The user’s given name.
The user’s family name.
Unique email address for this user.
Contact phone number, or
null if not provided.Timestamp of record creation, set automatically by the database.
Timestamp of the last update, maintained automatically by the database.
Example
Error cases
| Status | Reason |
|---|---|
401 Unauthorized | Missing or expired Authorization bearer token. |
403 Forbidden | Authenticated principal lacks the employee.manage permission. |
400 Bad Request | Request body fails class-validator rules (e.g., email is not a valid address). |
GET /users/:id
Retrieves a single user by their UUID. Required permission: None (authentication is still required via thePermissionGuard).
Path parameters
The UUID of the user to retrieve.
Response
Returns the matchingUser object, or null if no record exists for the provided ID.
UUID primary key of the user.
The user’s given name.
The user’s family name.
Unique email address for this user.
Contact phone number, or
null if not set.Timestamp of record creation.
Timestamp of the last update.
Example
Error cases
| Status | Reason |
|---|---|
401 Unauthorized | Missing or expired Authorization bearer token. |