Rename an existing department and optionally update its description within a business customer's team structure.
Rename a Department
This endpoint allows an authorized user (typically an Owner or a Partner) to rename an existing department and optionally update its description. Departments are organizational entities used to group sub-users within a business, helping to define internal access boundaries and role groupings. Department names can reflect functional units as teams evolve and reorganize.
Endpoint
PUT /api/teams/departments
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 reorganizing internal team structures and needing to update a department's name or description to reflect new functional groupings. For example, renaming "Support Team" to "Customer Success" or updating a department description to clarify its purpose. Departments are exclusively used for sub-user management and are not exposed to end customers.
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
| departmentId | integer (int32) | Yes | Unique ID of the department to rename |
| name | string | Yes | New name for the department (1–128 characters) |
| description | string or null | No | Optional updated description of the department (max 2048 characters) |
{
"departmentId": 42,
"name": "Customer Success",
"description": "Handles post-sale customer support and onboarding for all business accounts."
}Response
200 OK
| Field | Type | Description |
|---|---|---|
| id | integer (int32) | ID of the updated department |
| name | string | Updated department name |
| description | string or null | Updated department description, or null if not set |
| creator | object | Object containing the creator's id (int32) and name (string) |
| authorizedUserCount | integer (int32) | Number of sub-users currently assigned to this department |
{
"id": 42,
"name": "Customer Success",
"description": "Handles post-sale customer support and onboarding for all business accounts.",
"creator": {
"id": 7,
"name": "Jane Smith"
},
"authorizedUserCount": 5
}Error Codes
| Code | When it happens |
|---|---|
| 400 | Missing required fields, invalid departmentId, or name exceeds 128 characters |
| 401 | Token missing, expired, or invalid |
| 403 | Caller does not have Owner or Partner permissions to update the department |
| 404 | No department found matching the provided departmentId |
| 500 | Internal server error |
Common Mistakes
- Omitting
departmentId— this field is required to identify which department to rename; without it the request will be rejected with a 400 error. - Providing a
namethat exceeds 128 characters — the schema enforces a maximum length of 128 characters for the department name. - Sending a
descriptionthat exceeds 2048 characters — the description field has a maximum length of 2048 characters. - Calling this endpoint as a sub-user without Owner or Partner privileges — only Owners and Partners are authorized to rename departments.
Related Endpoints
POST /api/teams/departments— Create a new departmentGET /api/teams/departments— List all departments for the businessDELETE /api/teams/departments/{departmentId}— Delete a department
Example
curl -X PUT https://api.banking.netevia.dev/api/teams/departments \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"departmentId": 42,
"name": "Customer Success",
"description": "Handles post-sale customer support and onboarding for all business accounts."
}'