Endpoint used for user authentication in the system. Upon successful login, it returns a JWT token that should be used to authorize subsequent requests.
| Property | Value |
|---|---|
| Method | POST |
| URL | /api/auth/login |
| Content-Type | application/json |
| Authentication | None |
| Parameter | Type | Required | Description |
|---|---|---|---|
username |
string | Yes | User's username |
password |
string | Yes | User's password |
{
"username": "john.doe",
"password": "securePassword123"
}
| 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 |
{
"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 |
{
"message": "Username or password is incorrect"
}
| Parameter | Type | Description |
|---|---|---|
message |
string | Human-readable error message |