Skip to main content

POST /auth/login

This endpoint allows a user to log in by providing their email and password. On successful authentication, it returns access and refresh tokens for subsequent API requests.

Request Body

email
string
required
The email address of the user.
password
string
required
The password for the account.

Response

success
boolean
Indicates if the login was successful.
message
string
Human-readable status message.
user
object
An object containing the user’s information.
tokens
object
An object containing the authentication tokens.
curl -X POST https://api.llmgenerator.com/api/v1/auth/login \
  -H "Content-Type: application/json" \
  -d '{
        "email": "[email protected]",
        "password": "securePassword123"
      }'
{
  "success": true,
  "message": "Login successful",
  "user": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "email": "[email protected]",
    "name": "John Doe",
    "emailVerified": true,
    "updatedAt": "2026-01-29T12:00:00.000Z"
  },
  "tokens": {
    "accessToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
    "refreshToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
    "expiresIn": 900,
    "tokenType": "Bearer"
  }
}