Skip to main content

Endpoint

POST /api/users/login

Request Body

username
string
required
The username of the account to authenticate.
password
string
required
The account password for authentication.

Response

Success response (200 OK)
message
string
Confirmation message: “Login successful”
userId
integer
The unique ID of the authenticated user
username
string
The username of the authenticated user

Example Request

curl -X POST https://api.mediguide.com/api/users/login \
  -H "Content-Type: application/json" \
  -d '{
    "username": "john_doe",
    "password": "securePassword123"
  }'

Example Response

{
  "message": "Login successful",
  "userId": 42,
  "username": "john_doe"
}

Error Responses

401 Unauthorized - Invalid Credentials

{
  "error": "Usuario o contraseña incorrectos"
}
This error is returned when:
  • The username does not exist in the system
  • The password does not match the stored password

500 Internal Server Error

{
  "error": "Error message details"
}

Build docs developers (and LLMs) love