Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/jparra-amell/api_solsql/llms.txt

Use this file to discover all available pages before exploring further.

Authenticate a user against the database. The API looks up the account by email and role, verifies the plain-text password against the stored BCrypt hash, and returns the matching user record — minus the Password field — on success.
This API does not issue JWT tokens. The returned user object is your authentication record. Store it client-side as needed to track the current session.

Endpoint

POST /api/LoginRequest/login

Request body

Email
string
required
The user’s email address. Used together with Role to look up the account.
Password
string
required
The user’s plain-text password. The API verifies this value against the BCrypt hash stored in the database.
Role
integer
required
The user’s role: 1 for regular users, 2 for administrators. The login call will fail if the role does not match the record in the database.

Response fields

On success the API returns 200 OK with a user object. The Password field is always null in the response.
Id
integer
Unique identifier of the authenticated user.
Name
string
Full name of the authenticated user.
Email
string
Email address of the authenticated user.
Password
string | null
Always null in the response. The BCrypt hash is cleared before the object is returned.
Role
integer
Role of the authenticated user: 1 for regular users, 2 for administrators.
The login endpoint uses the LoginRequest model, which contains Id, Name, Email, Password, and Role. It does not include Status or Created_at. Use GET /api/vw_user/{id} if you need the full user profile after login.

Examples

curl --request POST \
  --url https://your-api-host/api/LoginRequest/login \
  --header 'Content-Type: application/json' \
  --data '{
    "Email": "[email protected]",
    "Password": "supersecret123",
    "Role": 1
  }'

Success response — 200 OK

{
  "Id": 42,
  "Name": "Maria Garcia",
  "Email": "[email protected]",
  "Password": null,
  "Role": 1
}
Password is always null in the response — the API clears the hash before returning the object.

Error responses

StatusMessageDescription
401 UnauthorizedUser not foundNo account matches the provided email and role.
401 UnauthorizedInvalid roleAn account was found but the stored role does not match the requested role.
401 UnauthorizedInvalid credentialsThe password did not pass BCrypt verification.
500 Internal Server ErrorerrorA database or unexpected server error occurred.
401 — Invalid credentials
{
  "message": "Invalid credentials"
}
500 — Server error
{
  "message": "Unexpected error",
  "error": "Details about the exception"
}

Build docs developers (and LLMs) love