Skip to main content
POST
/
api
/
auth
/
login
{
  "email": "user@example.com",
  "password": "SecurePassword123!"
}
{
  "message": "Login successful",
  "user": {
    "id": 1,
    "email": "user@example.com",
    "first_name": "John",
    "last_name": "Doe",
    "full_name": "John Doe",
    "short_name": "John",
    "phone_number": "+255614853618",
    "timezone": "Africa/Dar_es_Salaam",
    "is_verified": true,
    "is_active": true,
    "phone_verified": true,
    "email_notifications": true,
    "sms_notifications": false,
    "created_at": "2025-11-27T10:30:00Z",
    "updated_at": "2025-11-27T10:30:00Z",
    "last_login_at": "2025-11-27T10:30:00Z"
  },
  "tokens": {
    "refresh": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9...",
    "access": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9..."
  }
}
Authenticate and receive access tokens.
email
string
required
User email address
password
string
required
User password

Request Example

{
  "email": "user@example.com",
  "password": "SecurePassword123!"
}

Success Response (200)

message
string
Success message
user
object
User object with profile details
tokens
object
Access and refresh tokens
{
  "message": "Login successful",
  "user": {
    "id": 1,
    "email": "user@example.com",
    "first_name": "John",
    "last_name": "Doe",
    "full_name": "John Doe",
    "short_name": "John",
    "phone_number": "+255614853618",
    "timezone": "Africa/Dar_es_Salaam",
    "is_verified": true,
    "is_active": true,
    "phone_verified": true,
    "email_notifications": true,
    "sms_notifications": false,
    "created_at": "2025-11-27T10:30:00Z",
    "updated_at": "2025-11-27T10:30:00Z",
    "last_login_at": "2025-11-27T10:30:00Z"
  },
  "tokens": {
    "refresh": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9...",
    "access": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9..."
  }
}

Error Response (400)

{
  "non_field_errors": ["Invalid credentials."]
}

Error Response (400) - Account Not Verified

{
  "non_field_errors": [
    "Your account has not been activated. We have sent a 6-digit verification code to your email. Please check your email and use the code to verify your account, or visit /api/auth/resend-activation/ to resend."
  ]
}