This endpoint creates a new user account in the Monitor system. Only authenticated users with theDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/sheeplettuce/Monitor/llms.txt
Use this file to discover all available pages before exploring further.
Administrador role can create new accounts — there is no self-registration flow. The new user’s password is immediately hashed before being stored; the plaintext value is never persisted.
Endpoint
POST /api/auth/register — requires Authorization: Bearer <token> with Administrador role. Protected by the verificarToken and soloAdmin middleware chain.
Request Body
Unique login name for the new user. Must not contain any whitespace characters. Returns a
400 if the username is already taken.Password in plaintext. Stored as a bcrypt hash with a cost factor of 10. The plaintext value is never written to the database.
Role to assign to the new user. Must be exactly one of:
Administrador, Operador, Tecnico. Any other value returns a 400.Optional display name for the user (e.g. full name). Stored as-is; may be
null if omitted.Example Request
Success Response
Status:201 Created
The response body contains the newly created user’s profile. The password_hash field is never included in the response.
The auto-assigned unique numeric identifier for the new user.
The user’s display name, or
null if nombre was not provided in the request.The login name for the new user.
The role assigned to the new user. One of:
Administrador, Operador, Tecnico.Error Responses
| Status | Condition | Response Body |
|---|---|---|
400 Bad Request | username, password, or rol is missing | { "error": "username, password y rol son requeridos" } |
400 Bad Request | username contains whitespace characters | { "error": "El usuario no puede contener espacios" } |
400 Bad Request | rol is not one of the accepted values | { "error": "Rol inválido. Debe ser: Administrador, Operador, Tecnico" } |
400 Bad Request | username is already registered | { "error": "El username ya está en uso" } |
401 Unauthorized | Authorization header is missing, malformed, or the token is invalid / expired | { "error": "Token requerido" } / { "error": "Token inválido o expirado" } |
403 Forbidden | Token is valid but the caller’s role is not Administrador | { "error": "Acceso restringido a administradores" } |