AuthnAuthzAPI
  1. Authentication
  • Overview
  • Authentication
    • Register a new user
      POST
    • Verify email address
      POST
    • Resend verification code
      POST
    • Login user
      POST
  1. Authentication

Login user

Developing
POST
/auth/login
Authenticates a user by verifying the provided email address and password. If the credentials are valid and the account meets the required conditions (such as having a verified email and active status), the system returns authentication tokens that can be used to access protected API endpoints. Failed authentication attempts return appropriate error responses and may be monitored or rate-limited for security purposes.
Constraints:
1.
The user can request 5 login attempts every 30 minutes.

Request

Body Params application/jsonRequired

Examples

Responses

🟒200Authenticated User
application/json
Body

🟠400Validation Error
🟠401Invalid Credentials
🟠429Login Attempts Exceeded
🟠403Account Not Verified
🟠403Account Deactivated
🟠403Account Suspended
🟠403Account Soft Deleted
🟠429Rate Limit Exceeded
πŸ”΄500Internal Server Error
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request POST 'http://localhost:3000/api/v1/auth/login' \
--header 'Content-Type: application/json' \
--data-raw '{
    "email": "chadrick42@yahoo.com",
    "password": "T8SyMAu5q&aGW%5"
}'
Response Response Example
200 - Example
{
    "status": "success",
    "message": "User authenticated successfully.",
    "access_token": "3b162492aafb7bc08a0adf3701064880602ca300f7f12620d08e358eec0cf86a",
    "data": {
        "id": "9604c63fe9a6bdaba65b1603fbd7d14b08fb7e41",
        "name": "Laura Boyle-Wisoky",
        "email": "casimir67@yahoo.com",
        "profile_picture": "https://avatars.githubusercontent.com/u/62815461",
        "account_status": "active",
        "email_verified": true,
        "email_verified_at": "2026-03-08T04:46:25.344Z",
        "last_login_geolocation": {
            "country_code": "KG",
            "country": "Eritrea",
            "region": "Torpside",
            "city": "North Valentine",
            "latitude": -7.1373,
            "longitude": -62.7068,
            "timezone": "Atlantic/St_Helena"
        },
        "created_at": "2026-03-08T04:46:25.345Z",
        "updated_at": "2026-03-08T04:46:25.345Z",
        "deleted_at": null
    }
}
Modified atΒ 2026-03-08 19:38:02
Previous
Resend verification code
Built with