Skip to main content
POST
https://api-dev.weir.ai/
/
auth
/
register
curl -X POST 'https://api.weir.ai/auth/register' \
  -H 'Authorization: Bearer YOUR_ADMIN_ACCESS_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{
    "fullname": "New Admin",
    "email": "[email protected]",
    "password": "SecureAdminPass123!",
    "role": "Admin"
  }'
{
  "data": {
    "adminId": "admin_987654321",
    "fullname": "New Admin",
    "email": "[email protected]",
    "role": "Admin",
    "createdAt": "2024-01-22T15:30:00Z"
  },
  "message": "Admin user created successfully",
  "status": "success"
}

Create Admin User

Create a new admin user account with admin privileges.
curl -X POST 'https://api.weir.ai/auth/register' \
  -H 'Authorization: Bearer YOUR_ADMIN_ACCESS_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{
    "fullname": "New Admin",
    "email": "[email protected]",
    "password": "SecureAdminPass123!",
    "role": "Admin"
  }'
{
  "data": {
    "adminId": "admin_987654321",
    "fullname": "New Admin",
    "email": "[email protected]",
    "role": "Admin",
    "createdAt": "2024-01-22T15:30:00Z"
  },
  "message": "Admin user created successfully",
  "status": "success"
}

Request Body

fullname
string
required
Admin’s full name.
email
string
required
Admin’s email address.
password
string
required
Admin password (must meet security requirements).
role
string
Admin role (Super_Admin, Admin, Support_Admin). Defaults to Admin.

Usage Examples

const createAdmin = async (adminData, accessToken) => {
  const response = await fetch('https://api.weir.ai/auth/register', {
    method: 'POST',
    headers: {
      'Authorization': `Bearer ${accessToken}`,
      'Content-Type': 'application/json'
    },
    body: JSON.stringify(adminData)
  });
  if (!response.ok) throw new Error(`HTTP error! status: ${response.status}`);
  return await response.json();
};
Super Admin Only: Only Super_Admin users can create new admin accounts.