Admin Users
POST
Create Admin User
Create a new admin user with specified roles and permissions.
Required Permission:
Create Admin
POST
/dashboard/admin-users
Request Body
JSONRequest Parameters
| Parameter | Type | Required | Validation | Description |
|---|---|---|---|---|
| name | String | Required | string | Full name of the admin user |
| username | String | Required | string, unique | Username (must be unique) |
| String | Required | email, unique | Valid email address (must be unique) | |
| password | String | Required | string, min:6 | Password (minimum 6 characters) |
| mobile | String | Optional | string | Mobile phone number |
| photo | File | Optional | image, jpeg,png,jpg,webp | max:2MB | Profile photo (JPEG, PNG, JPG, WEBP, max 2MB) |
| role_id | Array | Optional | array | Array of role IDs |
| role_id.* | Integer | Optional | exists:roles,id | Each role ID must exist (if role_id is provided) |
Important Notes:
- Username and email must be unique across all users
- Password is required for creation, optional for updates
- Photo must be sent as multipart/form-data if uploading a file
- role_id is an array - you can assign multiple roles to a user
Response
200 OKStatus Code
HTTP status code (200)
Message
Success confirmation message
Data
Created admin user with assigned roles