TheDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/Eleazarguitar18/kantuta_pos_back/llms.txt
Use this file to discover all available pages before exploring further.
/usuario resource handles everything related to user accounts in Kantuta POS. The registration endpoint is public and atomically creates both a Usuario (login credentials and display name) and its linked Persona (personal profile — real name, birthdate, gender) in a single request. All other endpoints require a valid Bearer token. There is a strict one-to-one relationship between a Usuario and a Persona: you cannot have a user without a personal profile.
POST /usuario/register is the only public endpoint in this resource. All other operations require Authorization: Bearer <access_token>.POST /usuario/register
PUBLIC Registers a new user account and simultaneously creates the linkedPersona record in a single atomic operation. The combined request body carries both the login credentials and the personal profile fields. On success the full Usuario object — including the populated persona relation — is returned.
You do not need to call
POST /persona separately when registering a user. This endpoint creates both records in one transaction.Request body
The new user’s email address. Must be unique across the system and in a valid email format.
The new user’s password in plain text. Hashed server-side with bcrypt before storage.
Given name(s) for the user’s personal profile. Stored in the
Persona record (max 100 characters).First (paternal) surname. Stored in the
Persona record (max 50 characters).Second (maternal) surname. Stored in the
Persona record (max 50 characters).Date of birth in
YYYY-MM-DD format — e.g. "1995-03-22".Gender code. Typical values:
"M" (male) or "F" (female).Optional display name shown in the UI (e.g. a username or alias). Defaults to the email prefix if omitted.
Whether the account is active immediately on creation. Defaults to
true.Response
Returns the newly createdUsuario object with the embedded Persona and Role.
Auto-generated primary key of the user account.
Display name for the account.
The registered email address.
Account active flag —
true if the account is enabled.The personal profile record automatically created alongside this account. See the Persona interface below.
The role assigned to the account. Defaults to the base user role unless
id_role is specified.ISO 8601 timestamp of account creation.
ISO 8601 timestamp of the last update.
GET /usuario
PROTECTED Returns all registered user accounts as an array. Each user record includes the linkedPersona and Role objects. Deactivated accounts (estado: false) are included in the response — filter client-side if needed.
Request headers
Bearer <access_token> — obtained from POST /auth/login.Response
HTTP status code mirrored in the body —
200 on success.Human-readable status message, e.g.
"Listado de usuarios registradas!".Array of
Usuario objects, each containing nested persona and role.GET /usuario/:id
PROTECTED Retrieves a singleUsuario by its numeric ID, including the linked Persona and Role.
Path parameters
The numeric primary key of the user to retrieve.
Request headers
Bearer <access_token>.Response
200 on success."Usuario encontrado!" on success.The requested user with nested
persona and role.PATCH /usuario/:id
PROTECTED Partially updates a user account. Only the fields included in the request body are modified. To update the linked personal profile (name, birthdate, etc.) usePUT /persona instead.
Path parameters
The numeric ID of the user account to update.
Request headers
Bearer <access_token>.Request body (all fields optional)
Updated display name.
Updated email address. Must be unique across all user accounts.
New password in plain text. Hashed before storage.
Set to
false to deactivate the account without deleting it.Response
Returns the updatedUsuario object.
DELETE /usuario/:id
PROTECTED Removes the user account identified byid. Requires a valid Bearer token.
Path parameters
The numeric primary key of the user account to delete.
Request headers
Bearer <access_token> — obtained from POST /auth/login.Response
Returns the result from the underlying service call on success.Usuario TypeScript Interface
Use these interfaces in your React + TypeScript frontend (e.g.src/types/api.d.ts):