Skip to main content

Register New User

POST 

/auth/register

Endpoint to create new user accounts with an associated company. Typical Flow:

  1. The client sends user and company data
  2. The server validates that the email and CIF (Tax ID) are unique
  3. Creates both the user and the company in a single operation
  4. Automatically assigns the user as the administrator of the new company
  5. Returns a JWT token and information of the created user Usage Examples:
  • Registration of new companies on the platform
  • Automatic user and company onboarding
  • Creation of trial or demo accounts Applied Validations:
  • Email must be unique in the system
  • Company CIF/NIF (Tax ID) must be unique
  • Password minimum 6 characters
  • Email must have a valid format
  • CIF must be between 6 and 15 characters Important Notes:
  • Both user and company are created in an atomic transaction
  • The user is automatically assigned as the company admin
  • A verification email is automatically sent
  • The company starts with the "default" plan
  • The account type can be updated later Automatically Created Data:
  • Unique ID for user and company
  • Creation timestamps (createdAt, updatedAt)
  • Active status by default
  • Email verification token

Request

Responses

User and company created successfully