Authentication API
Complete API reference for user authentication, registration, and account management endpoints.
Base URL
https://api.loopingbinary.comRegister User
POST
/api/auth/registerCreate a new user account with email and password.
Request Body
JSON
{
"email": "user@example.com",
"password": "SecurePass123!",
"fullName": "John Doe"
}Parameters
| Field | Type | Required | Description |
|---|---|---|---|
| string | Yes | Valid email address | |
| password | string | Yes | Min 8 characters |
| fullName | string | Yes | User's full name |
Response (201 Created)
{
"message": "User registered successfully",
"user": {
"id": 123,
"email": "user@example.com",
"fullName": "John Doe",
"role": "USER",
"isVerified": false
},
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
}Login
POST
/api/auth/loginAuthenticate user and receive JWT token.
Request Body
{
"email": "user@example.com",
"password": "SecurePass123!"
}Response (200 OK)
{
"message": "Login successful",
"user": {
"id": 123,
"email": "user@example.com",
"fullName": "John Doe",
"role": "USER",
"isVerified": true
},
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
}Get Current User
GET
/api/auth/meGet authenticated user's profile information.
Headers
Authorization: Bearer <token>Response (200 OK)
{
"user": {
"id": 123,
"email": "user@example.com",
"fullName": "John Doe",
"role": "USER",
"isVerified": true,
"createdAt": "2025-01-15T10:30:00Z",
"wallet": {
"balance": 250.50
}
}
}Verify Email
POST
/api/auth/verify-emailVerify user's email address using token from email.
Request Body
{
"token": "verification_token_from_email"
}Response (200 OK)
{
"message": "Email verified successfully"
}Forgot Password
POST
/api/auth/forgot-passwordRequest password reset email.
Request Body
{
"email": "user@example.com"
}Response (200 OK)
{
"message": "Password reset email sent"
}Reset Password
POST
/api/auth/reset-passwordReset password using token from email.
Request Body
{
"token": "reset_token_from_email",
"newPassword": "NewSecurePass123!"
}Response (200 OK)
{
"message": "Password reset successful"
}OAuth Endpoints
GET
/api/auth/lb-oauthInitiate Looping Binary OAuth login flow
Error Responses
| Status Code | Error | Description |
|---|---|---|
| 400 | Bad Request | Invalid input data |
| 401 | Unauthorized | Invalid credentials or token |
| 404 | Not Found | User not found |
| 409 | Conflict | Email already exists |
| 500 | Internal Server Error | Server error occurred |