Login
Description
The login endpoint authenticates users and allows them to access their accounts.
HTTP method POST
Endpoint
https://7ahayhpwz9.execute-api.us-west-2.amazonaws.com/prod/security/api/auth/login
Request body
| NAME | REQUIRED | TYPE |
|---|---|---|
| username | ✅ | string |
| password | ✅ | string |
Request body example
{
"username": "root",
"password": "root"
}
Status code responses
| Code | Description |
|---|---|
| 200 | Return a body response with token |
| 400 | Bad request |
| 404 | Not Found |
| 500 | Internal Server Error |
The full documentation error codes can be found here.
Response 200 status code
{
"token": "eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJlMTlkNjg5YS00ZDVhLTExZWQtYmRjMy0wMjQyYWMxMjAwMDIiLCJhdXRoIjoiUk9MRV9CMkNfVVNFUiIsImlhdCI6MTY4MzE0MjQ5OCwiZXhwIjoxNjgzMTUxNDk4fQ.M9Ir0hefBhQmTOHtRo-HT_1yKOkvCDWivZPkbyDfEmm7Gh8ZRPXIb2iTcxyADbvGK1gU2SWFxL0g_WSUzmQusw",
"expiration": 150
}
Response 400 status code
{
"traceId": "a5bef650a58ac590",
"timestamp": "2023-05-08 11:47:32",
"code": "SEC-1001",
"message": "A generic error has occurred.",
"data": null
}
Response 401 status code
{
"traceId": "43a20f33d4e8730d",
"timestamp": "yyyy-mm-dd HH:MM:SS",
"code": "SEC-1004",
"message": "Access denied."
}
Response 404 status code
{
"traceId": "43a20f33d4e8730d",
"timestamp": "yyyy-mm-dd HH:MM:SS",
"code": "SEC-1004",
"message": "User not found."
}
Response 500 status code
{
"traceId": "43a20f33d4e8730d",
"timestamp": "yyyy-mm-dd HH:MM:SS",
"code": "SEC-1001",
"message": "A generic error has occurred.",
"data": null
}