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.

Request Body

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

Response

user
object
An object containing the user’s information.
id
string
The unique identifier for the user.
tokens
object
An object containing the authentication tokens.
accessToken
string
The access token for authenticating subsequent requests. Use this in the Authorization header as a Bearer token.
refreshToken
string
The refresh token for obtaining new access tokens.
curl -X POST https://api.llmgenerator.com/api/v1/auth/login \
  -H "Content-Type: application/json" \
  -d '{
        "email": "[email protected]",
        "password": "securePassword123"
      }'
{
  "user": {
    "id": "user_xxxxxxxxx",
    "email": "[email protected]",
    "firstName": "John"
  },
  "tokens": {
    "accessToken": "ey...",
    "refreshToken": "ey..."
  }
}