Login Log
Login Logs is a simple API to record a login event (e.g. successful login) and retrieve a list of events.
Create
Create a login log:
POST /v1/login_logs
- Parameters
- Response
- Sample Request
- Sample Response
- Errors
name | type | req | desc |
---|---|---|---|
user_id | string [1..100] | ✓ | The |
status | int | ✓ | An integer which maps to your login events. For example, |
payload | any | Arbitrary data to associate with the login log. This data will be returned when listing the login logs. This can be omitted/null. |
name | type | desc |
---|---|---|
id | uuid | The id of the created log. |
curl -X POST "http://127.0.0.1:5200/v1/login_logs" \
-H "Content-Type: application/json" \
-d '{
"user_id": "d65d8f1a-4380-45e0-bfd3-819ddb4504df",
"status": 1,
"payload": {"from": "reset_passwrod"}
}'
{"id":"4cf3670b-0d3b-4d98-b0d4-ac4ff42f445a"}
code | desc | |
---|---|---|
102012 | The project has reached the maximum configured login logs. | |
102013 | The |
The general error section details Authen's error responses as well as detailing all errors, including global errors, such as validation and internal server errors.
List
Returns the login logs for a user.
GET /v1/login_logs
- Parameters
- Response
- Sample Request
- Sample Response
- Errors
name | type | req | desc |
---|---|---|---|
user_id | string [1..100] | ✓ | The |
page | int[1..] | Fetch the specified page. Defaults to | |
perpage | int[1..] | Fetch the specified number of records per page. Defaults to |
name | type | desc |
---|---|---|
id | uuid | The id of the login log. |
status | int | The status associated with the login log when it was created. |
created | datetime | RFC 3339 time that login log was created. |
payload | any | The data, if any, associated with the login log when it was created. |
curl "http://127.0.0.1:5200/v1/login_logs?"\
"user_id=d65d8f1a-4380-45e0-bfd3-819ddb4504df"\
"&perpage=10&page=1"
{
"results":
[
{
"id": "4cf3670b-0d3b-4d98-b0d4-ac4ff42f445a",
"status": 1,
"payload":{"from": "reset_passwrod"},
"created": "2022-11-08T09:52:50.366285+00:00"
}
]
}
The general error section details Authen's error responses as well as detailing all errors, including global errors, such as validation and internal server errors.