User login
Authentication
User Login
Authenticate a user with email and password. Returns user details and authentication token.
POST
User login
Overview
Authenticate a user with email and password. Returns user details, authentication token, and onboarding status flags. The token should be used for all subsequent API requests.Request Body
User’s email address.Format: Valid email addressExample:
"user@example.com"User’s password.Example:
"yourSecurePassword123"Response
User’s unique identifier.
User’s full name.
User’s email address.
URL to user’s profile picture.
ID of the user’s current active team.
Authentication token for API requests. Use this in the
Authorization: Bearer {token} header.User’s role in the current team.Possible values:
"owner", "manager", "member", "client"Whether the user has admin privileges in the team.Possible values:
"yes", "no"Number of contacts the user has.
Onboarding flag: Whether the first project has been added.Values:
0 (not added), 1 (added)Onboarding flag: Whether the first task has been added.Values:
0 (not added), 1 (added)Onboarding flag: Whether the first team member has been invited.Values:
0 (not invited), 1 (invited)User’s timezone setting.
Timestamp of two-factor authentication confirmation (if enabled).
Timestamp when the user account was created.
Timestamp when the user account was last updated.
Example Request
Example Request (JavaScript)
Example Response
Example Response - New Team Owner
Error Responses
Authentication Token Usage
After successful login, use the returned token in all subsequent API requests:Onboarding Flags
The response includes three onboarding flags to help guide new users:is_first_project_added
0: No projects have been created yet (show project creation prompt)1: At least one project exists (skip project creation prompt)- Applies to: Owners and managers only
is_first_task_added
0: No tasks have been created yet (show task creation prompt)1: At least one task exists (skip task creation prompt)- Applies to: Owners and managers only
is_first_member_invited
0: Team only has the owner (show member invitation prompt)1: At least one additional member exists (skip invitation prompt)- Applies to: Owners only
User Roles
| Role | Description | Permissions |
|---|---|---|
owner | Team owner | Full access to all features and settings |
manager | Team manager | Can manage projects, tasks, and team members |
member | Regular member | Can work on assigned tasks and projects |
client | External client | Limited access to assigned projects only |
Role-Based Response Differences
Owner/Manager Response
Includes onboarding flags for projects and tasks:Member/Client Response
Onboarding flags default to 1 (completed):Login Behavior
On Successful Login:
- Authentication: Validates email and password
- Login method reset: Clears any previous login method (OAuth, etc.)
- Token generation: Creates new authentication token
- Role detection: Retrieves user’s role in current team
- Admin status: Checks if user has admin privileges
- Contact count: Calculates number of user contacts
- Onboarding status: Determines which setup steps are complete
- Response: Returns complete user profile with token
Security Features:
- Passwords are hashed and never returned
- Tokens are unique per session
- Failed login attempts can be rate-limited
- Login method tracking for security audits
-
Team context:
current_team_iddetermines which team’s data to display
Security Considerations
- HTTPS only: Always use HTTPS for login requests
- Token protection: Treat tokens like passwords - never expose in URLs or logs
- Token expiration: Implement token expiration and refresh mechanisms
- Failed attempts: Monitor and limit failed login attempts
- Password requirements: Enforce strong password policies during registration
- Two-factor auth: Enable 2FA for enhanced security
- Session management: Properly handle token revocation on logout
Related Endpoints
- Register User - Create a new user account
- Logout - Invalidate authentication token
- Forgot Password - Request password reset
- Reset Password - Reset user password
- Get User Profile - Retrieve current user details
- Update Profile - Update user information
- Refresh Token - Get a new authentication token
Body
application/json
Response
Login successful
Example:
1
Example:
"John Doe"
Example:
"john.doe@example.com"
Example:
"https://s3.amazonaws.com/bucket/profiles/user-1.jpg"
Example:
5
Bearer token for API authentication
Example:
"1|Ab3dEfGh1Jk2Lm3No4Pq5Rs6Tt7Uv8Wx9Yz0"
Available options:
owner, manager, member, client Example:
"owner"
Available options:
yes, no Example:
"yes"
Example:
15
0 = not added, 1 = added
Available options:
0, 1 Example:
1
0 = not added, 1 = added
Available options:
0, 1 Example:
1
0 = not invited, 1 = invited
Available options:
0, 1 Example:
1
Example:
"America/New_York"