Check current user information
Retrieve information about the currently authenticated user, including permissions and role.
Endpoint
GET /whoami
Authentication
Header | Value |
---|---|
Authorization | Bearer <jwt_token> |
Example Request
curl -X GET http://localhost:9000/whoami \
-H "Authorization: Bearer <jwt_token>"
Response
Success Response (200 OK)
Admin User Response
{
"id": "67ffc3f5a2120e73468ce66c",
"username": "admin",
"is_admin": true
}
Team User Response
{
"id": "6800be205e5d00c1c14fe244",
"username": "teamuser1",
"is_admin": false,
"owner": "admin",
"permissions": {
"Apps": {
"Create": true,
"Delete": false,
"Edit": false,
"Download": true,
"Upload": true,
"Allowed": [
"67fe34c804d701fb7f3cc656",
"67fe3669cebd0550e07763de"
]
},
"Channels": {
"Create": true,
"Delete": false,
"Edit": false,
"Allowed": [
"67f826fa5c0a2b68411b2111"
]
},
"Platforms": {
"Create": false,
"Delete": false,
"Edit": true,
"Allowed": [
"67f82615a27c60636bd57308"
]
},
"Archs": {
"Create": true,
"Delete": true,
"Edit": false,
"Allowed": [
"67f8261aa27c60636bd57309",
"67f827ac8ffe38b6de325c07"
]
}
}
}
Response Fields
Common Fields
Field | Type | Description |
---|---|---|
id | string | Unique identifier of the user |
username | string | Username of the authenticated user |
is_admin | boolean | Whether the user has administrative privileges |
Team User Additional Fields
Field | Type | Description |
---|---|---|
owner | string | Username of the admin who created this team user |
permissions | object | Detailed permissions for different resource types |
Permission Object Fields
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 |
Upload | boolean | Permission to upload files |
Allowed | array | List of resource IDs the user has access to |
Notes
- Admin users have full access to all resources and operations
- Team users have restricted access based on their assigned permissions
- The
Allowed
array contains IDs of specific resources the user can access - Use this endpoint to determine user capabilities and access rights
- Permissions are granular and can be customized per resource type