Login

Endpoint used for user authentication in the system. Upon successful login, it returns a JWT token that should be used to authorize subsequent requests.

Request

Property Value
Method POST
URL /api/auth/login
Content-Type application/json
Authentication None

Request Body

Parameter Type Required Description
username string Yes User's username
password string Yes User's password

Example Request

{
  "username": "john.doe",
  "password": "securePassword123"
}

Response

Status Codes

Code Description
200 Success - Authentication successful
400 Bad Request - Invalid parameters
401 Unauthorized - Invalid credentials
429 Too Many Requests - Rate limit exceeded
500 Internal Server Error

Successful Response (200)

{
  "data": {
    "accessToken": "eyJhbGc...",
    "tokenType": "Bearer",
    "expireDate": 1763638078917,
    "remainingTime": 899999,
    "username": "john.doe",
    "message": "Authentication successful"
  },
  "meta": {
    "executionTime": 9,
    "generatedAt": 1763637178918
  },
  "message": "Authentication successful"
}
Parameter Type Description
data.accessToken string JWT access token for authorizing subsequent requests
data.tokenType string Token type (always "Bearer")
data.expireDate integer Token expiration date (Unix timestamp in ms)
data.remainingTime integer Token validity time remaining in milliseconds
data.username string Username of the authenticated user
data.message string Message confirming successful authentication
meta.executionTime integer Request processing time in milliseconds
meta.generatedAt integer Response generation timestamp (Unix timestamp in ms)
message string Main response status message

Error Response (4xx/5xx)

{
  "message": "Username or password is incorrect"
}
Parameter Type Description
message string Human-readable error message

Notes

  • Token expires after 900 seconds (15 minutes).
  • Maximum 5 login attempts per minute per IP address.
  • Passwords must meet minimum security requirements.
  • Use HTTPS in production environments.