Skip to main content

Register User

Create a new user account with email, password, and name details.

πŸ“ Endpoint

πŸ“‹ Request Body

string
required
The user’s email address. Must be a valid email format.
string
required
The user’s password. Must be at least 8 characters long.
string
required
The user’s first name.
string
required
The user’s last name.

πŸ“€ Request Example

πŸ“₯ Response

Success (201 Created)

Error Responses

Email Already Exists (400 Bad Request)

Invalid Email Format (400 Bad Request)

Password Too Short (400 Bad Request)

πŸ” What Happens After Registration

  1. Team Creation: A new team is automatically created for the user
  2. Role Assignment: User is assigned the ADMIN role for their team
  3. Default Permissions: User receives default permissions for their role
  4. Token Generation: Access and refresh tokens are generated
  5. Welcome Email: A welcome email is sent to the user

πŸ›‘οΈ Security Features

  • Password Hashing: Passwords are hashed using bcrypt
  • Email Verification: Email format is validated
  • Rate Limiting: Registration is rate-limited to prevent abuse
  • Team Isolation: Each user gets their own team by default

πŸ“‹ Validation Rules

Email

  • Must be a valid email format
  • Must be unique across the system
  • Maximum length: 255 characters

Password

  • Minimum length: 8 characters
  • Should contain a mix of letters, numbers, and symbols
  • Cannot be a common password

Names

  • Minimum length: 2 characters
  • Maximum length: 50 characters
  • Can contain letters, spaces, hyphens, and apostrophes

πŸ”„ Next Steps

After successful registration:
  1. Store tokens securely in your application
  2. Use the access token for API requests
  3. Implement token refresh when the access token expires
  4. Set up team settings in the dashboard