Create Super Admin API
Overview
Creates a platform-level Super Admin user with full god-mode privileges across the SME OTA system.
- Endpoint:
/api/auth/create-super-admin - Method:
POST - Access: Super Admin / Internal Setup
Request Body Schema
| Field | Type | Required | Description |
|---|---|---|---|
firstName | String | Yes | Super admin first name |
lastName | String | No | Super admin last name |
email | String | Yes | Super admin email address |
password | String | Yes | Password (min 6 characters) |
phone | String | No | Phone number |
Request Body Example
{
"firstName": "Super",
"lastName": "Admin",
"email": "admin@routeledgers.com",
"password": "SuperSecretPassword123!",
"phone": "+919999999999"
}
Success Response (201 Created)
{
"success": true,
"message": "Super Admin user created successfully",
"data": {
"user": {
"id": "u0001-superadmin-uuid",
"email": "admin@routeledgers.com",
"firstName": "Super",
"lastName": "Admin",
"phone": "+919999999999",
"clientType": "B2B",
"active": true
},
"roles": [
"SUPER_ADMIN"
],
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
}
}
Database Impact
- Tables:
users,roles,user_role_maps - Operations:
INSERTintousersanduser_role_mapswithin a Prisma transaction.