API Method: POST /api/teams/departments/manage
/api/teams/departments/manage
**Description:**This endpoint allows authorized users (such as an Owner or a Partners) to manage the team members (sub-users) assigned to a department. You can add or remove sub-users from a specific department by providing their user IDs.
Departments are organizational structures within a company used exclusively for sub-user management. They help control access, permissions, and user groupings. Department creation and management are typically handled by high-level roles like Owners or Flax users, often acting on behalf of Authors.
This endpoint is particularly useful for companies managing multiple users in different operational areas (e.g., Finance, Compliance, Support) or needing to isolate certain users.
Departments are not customer-facing and are intended only for organizing sub-user roles internally.
Request:
-
Method: POST
-
Endpoint:
https://api.banking.netevia.dev/api/teams/departments/manage
-
Headers:
Authorization
: Bearer<access_token>
(required)Content-Type
:application/json
Body Parameters:
{
"departmentId": 0,
"addUserIds": [1, 2, 3],
"removeUserIds": [4, 5]
}
departmentId
(int32, required) – The ID of the department to modify.addUserIds
(array of int32 | null) – List of sub-user IDs to add to the department.removeUserIds
(array of int32 | null) – List of sub-user IDs to remove from the department.
Both addUserIds
and removeUserIds
are optional, but at least one must be provided.
Response:
- Status Code: 200 OK
- Content Type:
application/json
- Response Body:
{
"id": 0,
"name": "string",
"description": "string",
"creator": {
"id": 0,
"name": "string"
},
"authorizedUserCount": 0
}
Fields:
id
– Department IDname
– Department namedescription
– Description of the departmentcreator
– Object with creator'sid
andname
authorizedUserCount
– Total number of sub-users now assigned to this department
Error Responses:
- 400 Bad Request – Invalid input or missing parameters
- 401 Unauthorized – Invalid or missing authorization token
- 403 Forbidden – Insufficient permissions to manage department
- 404 Not Found – Department or user(s) not found
- 500 Internal Server Error – Unexpected server-side error
**Use Case Example:**A manager wants to reassign users:
- Add user IDs 101 and 102 to the "Risk Management" department
- Remove user ID 103 from that same department
This can be done in a single API call using this endpoint.