Skip to main content

List All Users

Retrieve a list of all users in the system.

Authentication

No authentication specified (should be protected in production).

Response

Exito
boolean
Indicates whether the operation was successful.
Mensaje
string
Error message if operation failed.
Data
array
Array of user objects.

Example

curl -X GET https://api.example.com/api/auth/Lista_Usuarios \
  -H "Content-Type: application/json"

Get User by ID

Retrieve a specific user by their ID.

Authentication

No authentication specified (should be protected in production).

Path Parameters

id
integer
required
The unique identifier of the user to retrieve.

Response

Exito
boolean
Indicates whether the user was found.
Mensaje
string
Error message if user not found: “No se encontró el expediente”
Data
object
User object.

Example

curl -X GET https://api.example.com/api/auth/Buscar/1 \
  -H "Content-Type: application/json"

Delete User

Delete a user from the system.

Authentication

No authentication specified (should be protected in production).

Path Parameters

id
integer
required
The unique identifier of the user to delete.

Response

Exito
boolean
Indicates whether the deletion was successful.
Mensaje
string
Error message if user not found: “No se pudo encontrar el expediente”
Data
integer
Not used in this endpoint.

Example

curl -X DELETE https://api.example.com/api/auth/Eliminar/1 \
  -H "Content-Type: application/json"

Change Password

Update a user’s password.

Authentication

No authentication specified (should be protected in production).

Request Body

UsuarioId
integer
required
The ID of the user whose password will be changed.
NuevaContrasena
string
required
The new password. Will be securely hashed before storage.

Response

Exito
boolean
Indicates whether the password was successfully updated.
Mensaje
string
Status message: “Contraseña actualizada correctamente” on success, or “Usuario no encontrado” if user not found.
Data
boolean
Returns true on successful password update.

Example

curl -X POST https://api.example.com/api/auth/CambiarContrasena \
  -H "Content-Type: application/json" \
  -d '{
    "UsuarioId": 1,
    "NuevaContrasena": "NewSecurePassword456"
  }'

Security Considerations

  • All password operations use ASP.NET Core Identity’s PasswordHasher
  • Passwords are never stored or transmitted in plain text
  • These endpoints should be protected with authentication and authorization in production
  • Consider implementing rate limiting on authentication endpoints
  • The Lista_Usuarios endpoint exposes hashed passwords - consider removing this in production

Build docs developers (and LLMs) love