Auth

Register user

POST
/api/auth/register

Create a new user account using an authenticated session. Superadmins may create Admin, Department Head, or Sales Rep accounts in any existing organization; admins may create Department Head or Sales Rep accounts in their own organization; department heads may create Sales Rep accounts only in their own department. Sales Reps cannot create accounts, and SUPERADMIN creation is always forbidden. Any supplied department must belong to the target organization. When WorkOS is enabled the user is also provisioned in WorkOS; otherwise the password is validated locally and hashed before persistence.

Authorization

bearerAuth
AuthorizationBearer <token>

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/api/auth/register" \  -H "Content-Type: application/json" \  -d '{    "email": "sam.patel@acme.example",    "password": "CorrectHorseBatteryStaple!",    "fullName": "Sam Patel",    "organizationId": "5f7b1c2e8a1d4e0012c3b4a5",    "accessRole": "SALES_REP",    "phoneNumber": "+14165550100",    "designation": "Customer Success Lead",    "departmentId": "6a8c2d3f9b1e5a0023d4c5b6"  }'
{  "message": "User registered successfully"}