AuthnAuthzAPI
Get Started
Get Started
  1. Authentication
  • Overview
  • Registration & Onboarding
    • Register a new user
      POST
    • Verify email address
      POST
    • Resend verification code
      POST
  • Authentication
    • Login user
      POST
    • Logout user
      POST
    • Request a password reset email
      POST
    • Verify password reset token
      POST
    • Update password
      POST
    • Refresh access token
      POST
    • Get current authenticated user
      GET
  • OAuth Authentication
    • OAuth authentication
      GET
    • OAuth callback
      GET
  • Session Management
    • Get all sessions
      GET
    • Revoke session
      DELETE
    • Revoke all sessions
      DELETE
  • Profile Management
    • View profile information
      GET
    • Update profile information
      PATCH
  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

🟢200Success
application/json
Bodyapplication/json

🟠400Validation Error
🟠401Invalid Credentials
🟠403Account Soft Deleted
🟠403Account Deactivated
🟠403Account Not Verified
🟠423Login Attempts Exceeded
🟠429Rate Limit Exceeded
🔴500Internal Server Error
Request Request Example
Shell
JavaScript
Java
Swift
curl --location '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 logged in successfully.",
    "data": {
        "access_token": "35bf6f55a2fe0e479899cd46410c0ee9f32fe89848e71bd780fe1c0a4897d70d",
        "user": {
            "id": "94cf57cc1945a0656de34fc4393cafff451bd12b",
            "name": "Malcolm Keebler",
            "email": "jamar_vonrueden62@hotmail.com",
            "profile_picture": "https://avatars.githubusercontent.com/u/82505485",
            "account_status": "active",
            "email_verified": true,
            "email_verified_at": "2026-05-17T23:46:29.760Z",
            "last_login_geolocation": {
                "country_code": "GQ",
                "country": "Virgin Islands, U.S.",
                "region": "North Abel",
                "city": "Grantfort",
                "latitude": 30.1912,
                "longitude": -131.1022,
                "timezone": "America/Swift_Current"
            },
            "created_at": "2026-05-17T23:46:29.762Z",
            "updated_at": "2026-05-17T23:46:29.762Z",
            "deleted_at": null
        }
    }
}
Modified at 2026-05-17 22:05:59
Previous
Authentication
Next
Logout user
Built with