Skip to main content
POST
/
api
/
auth
/
login
{
  "400": {},
  "401": {},
  "403": {},
  "success": true,
  "user": {},
  "tokens": {},
  "message": "<string>"
}

Description

Authenticate user and receive JWT tokens. Supports credentials provider with password verification.

Authentication

None (public endpoint)

Request Body

email
string
required
User email address
password
string
required
User password

Response

success
boolean
Whether the login was successful
user
object
User object with id, email, name, role, and planTier
tokens
object
JWT tokens (accessToken and refreshToken)
message
string
Success message

Example Request

curl -X POST https://api.convosphere.site/api/auth/login \
  -H "Content-Type: application/json" \
  -d '{
    "email": "user@example.com",
    "password": "your-password"
  }'

Example Response

{
  "success": true,
  "user": {
    "id": "user_123",
    "email": "user@example.com",
    "name": "John Doe",
    "role": "USER",
    "planTier": "starter"
  },
  "tokens": {
    "accessToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
    "refreshToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
  },
  "message": "Login successful"
}

Error Responses

400
object
Missing email or password
401
object
Invalid credentials
403
object
Email not verified