Manage a department's team

Manage a Department's Team

This endpoint allows authorized users (such as an Owner or a Partner) to manage the sub-users assigned to a department. You can add or remove sub-users from a specific department in a single request by providing their user IDs. Departments are internal organizational structures used exclusively for sub-user management and are not customer-facing.

Endpoint

POST /api/teams/departments/manage

Authentication

Bearer token required. Obtain via:

POST https://api.banking.netevia.dev/api/auth/v2

Include in header: Authorization: Bearer {token}
Token lifetime: 10 minutes. Refresh via POST /api/auth/refresh.

When to use

Use this endpoint when you need to reorganize sub-users across departments — for example, onboarding new team members into a functional group such as Finance or Compliance, or offboarding users who have changed roles. It is designed for business accounts where departments help control access levels, permissions, and user groupings across multiple operational areas. Both add and remove operations can be performed in a single call, keeping department membership synchronized in real time.

Request Body

FieldTypeRequiredDescription
departmentIdinteger (int32)YesThe ID of the department to modify.
addUserIdsarray of integer (int32)NoList of sub-user IDs to add to the department. At least one of addUserIds or removeUserIds must be provided.
removeUserIdsarray of integer (int32)NoList of sub-user IDs to remove from the department. At least one of addUserIds or removeUserIds must be provided.
{
  "departmentId": 42,
  "addUserIds": [101, 102],
  "removeUserIds": [103]
}

Response

200 OK

FieldTypeDescription
idinteger (int32)The unique ID of the department.
namestringThe name of the department.
descriptionstringA description of the department.
creatorobjectAn object containing the ID and name of the user who created the department.
creator.idinteger (int32)The creator's user ID.
creator.namestringThe creator's display name.
authorizedUserCountinteger (int32)The total number of sub-users currently assigned to this department after the operation.
{
  "id": 42,
  "name": "Risk Management",
  "description": "Handles risk assessment and compliance monitoring.",
  "creator": {
    "id": 7,
    "name": "Jane Smith"
  },
  "authorizedUserCount": 5
}

Error Codes

CodeWhen it happens
400Missing required fields, invalid parameter types, or neither addUserIds nor removeUserIds provided
401Token missing, expired, or invalid
403Caller lacks permission to manage department membership (e.g., not an Owner or Partner-level role)
404Specified department ID or one or more user IDs not found
500Internal server error

Common Mistakes

  • Providing neither addUserIds nor removeUserIds — at least one must be present and non-empty to perform a meaningful update.
  • Supplying a departmentId that does not exist or belongs to a different business account, resulting in a 404 error.
  • Including a user ID in both addUserIds and removeUserIds in the same request, which produces conflicting instructions and may result in a 400 error.
  • Using a token issued for a Personal customer account — departments and sub-user management are available for Business accounts only.

Related Endpoints

  • POST /api/teams/departments — Create a new department within a business account
  • GET /api/teams/departments — List all departments for the authenticated business
  • DELETE /api/teams/departments/{departmentId} — Delete a department
  • GET /api/teams/subprofiles — List sub-users (authorized users) available for department assignment

Example

curl -X POST https://api.banking.netevia.dev/api/teams/departments/manage \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "departmentId": 42,
    "addUserIds": [101, 102],
    "removeUserIds": [103]
  }'
Body Params
int32
removeUserIds
array of int32s | null
removeUserIds
addUserIds
array of int32s | null
addUserIds
Headers
string
enum
Defaults to application/json

Generated from available response content types

Allowed:
string
enum
Defaults to application/json

Generated from available request content types

Allowed:
Response

Language
Credentials
Bearer
JWT
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
text/plain
application/json
text/json