Create User
Create a new team user with specific permissions for different resources.
Endpoint
POST /user/create
Authentication
Header | Value |
---|---|
Authorization | Bearer <jwt_token> |
Content-Type | application/json |
Request Body
Field | Type | Required | Description |
---|---|---|---|
username | string | ✅ | Username for the new team user |
password | string | ✅ | Password for the new team user |
permissions | object | ✅ | Object containing permission settings for different resources |
Permissions Object Structure
Resource | Type | Description |
---|---|---|
apps | object | Permissions for application management |
channels | object | Permissions for channel management |
platforms | object | Permissions for platform management |
archs | object | Permissions for architecture management |
Permission Fields for Each Resource
Field | Type | Description |
---|---|---|
create | boolean | Permission to create new resources |
delete | boolean | Permission to delete resources |
edit | boolean | Permission to edit existing resources |
download | boolean | Permission to download files (apps only) |
upload | boolean | Permission to upload files (apps only) |
allowed | array | List of resource IDs the user has access to |
Example Request
curl -X POST \
'http://localhost:9000/user/create' \
-H 'Authorization: Bearer <jwt_token>' \
-H 'Content-Type: application/json' \
-d '{
"username": "teamuser1",
"password": "password123",
"permissions": {
"apps": {
"create": true,
"delete": false,
"edit": true,
"download": true,
"upload": false,
"allowed": [""]
},
"channels": {
"create": true,
"delete": false,
"edit": true,
"allowed": [""]
},
"platforms": {
"create": true,
"delete": false,
"edit": true,
"allowed": [""]
},
"archs": {
"create": true,
"delete": false,
"edit": true,
"allowed": [""]
}
}
}'
Response
Success Response (200 OK)
{
"message": "Team user created successfully"
}
Response Fields
Field | Type | Description |
---|---|---|
message | string | Confirmation message indicating successful user creation |
Notes
- Team users have restricted access based on their assigned permissions
- The
allowed
array contains IDs of specific resources the user can access - Passwords should follow security best practices
- Only admin users can create team users