Register User

Creates a new account. On successful registration, the system provisions the user's login record, default team, starting credits, and default permissions in a single transaction.

Endpoint

POST {{base_url}}/v1/auth/register

Headers

HeaderValue
Content-Typeapplication/json

This endpoint does not require authentication — it's used to create a new account.


Body Parameters

ParameterTypeRequiredDescription
firstnamestringYesUser's first name.
lastnamestringYesUser's last name.
emailstringYesEmail address. Must not already be registered.
usernamestringYesDesired username. Must not already be taken.
passwordstringYesAccount password. See Password Requirements below.
password_confirmationstringYesMust match password exactly.
mobile_nostringNoMobile number. If provided, must not already be registered.
countrystringNoUser's country.

Password Requirements

password must satisfy all of the following:

RuleRequirement
LengthAt least 8 characters
UppercaseAt least one uppercase letter (A–Z)
LowercaseAt least one lowercase letter (a–z)
DigitAt least one number (0–9)
Special characterAt least one non-alphanumeric character

If any rule fails, the request is rejected with the specific message for that rule (see Error Responses).


Example Request

{
  "firstname": "John",
  "lastname": "Doe",
  "email": "[email protected]",
  "username": "johndoe",
  "password": "Strong@123",
  "password_confirmation": "Strong@123",
  "mobile_no": "919876543210",
  "country": "India"
}
curl --location '{{base_url}}/v1/auth/register' \
--header 'Content-Type: application/json' \
--data '{
    "firstname": "John",
    "lastname": "Doe",
    "email": "[email protected]",
    "username": "johndoe",
    "password": "Strong@123",
    "password_confirmation": "Strong@123",
    "mobile_no": "919876543210",
    "country": "India"
}'

What Happens on Registration

When a registration request passes all validation, the following are created together (all-or-nothing — if any step fails, nothing is saved):

  1. Main account record — your login, profile, and account settings.

  2. Default team assignment — you're added to a default team.

  3. Starting credits — new accounts are seeded with:

    Credit typeStarting amount
    whatsapp_marketing_credits10
    whatsapp_utility_credits10
    voice_credits10
  4. Default permissions — a baseline permission set is created for the account (e.g. report access, broadcast via master reseller, read-status broadcast, voice credits access, client management, invoice, support, and reseller settings are enabled by default; several others like SMS credits, WhatsApp credits, RCS, GSM, Telegram, and Instagram are disabled by default).

Confirm the exact success response shape returned by the route (e.g. { "message": "..." } and/or user/account details) — the underlying function completes without returning a payload itself, so the response body depends on how the route wraps it.


Validation Rules

  • password must meet all Password Requirements.
  • password and password_confirmation must match exactly.
  • email must not already be registered.
  • username must not already be taken (checked against both admin accounts and assigned users).
  • mobile_no, if provided, must not already be registered to another account.

Error Responses

StatusMessageReason
400Password must be at least 8 charactersPassword too short.
400Password must contain at least one uppercase letterMissing uppercase letter.
400Password must contain at least one lowercase letterMissing lowercase letter.
400Password must contain at least one digitMissing a number.
400Password must contain at least one special characterMissing a special character.
400Passwords do not matchpassword and password_confirmation don't match.
409Email already registeredThe given email is already in use.
409Username already takenThe given username is already in use.
409Mobile number already registeredThe given mobile_no is already in use.

Notes

  • All uniqueness checks (email, username, mobile_no) run in parallel before anything is written, so you get the relevant conflict error without unnecessary account creation attempts.
  • Password is stored using bcrypt hashing — plaintext passwords are never stored.
  • If any part of account provisioning fails (main record, team, credits, or permissions), the entire registration is rolled back — no partial accounts are created.
  • country is optional and stored as-is if provided.