Remove a Department
This endpoint permanently deletes a department from the system using its unique integer department ID. Once removed, the department and any associated data will no longer be accessible. This operation is irreversible, so it should be performed with care.
Endpoint
DELETE /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 a department within a team structure needs to be permanently removed — for example, when reorganizing a business customer's team hierarchy or cleaning up departments that are no longer active. This is typically called after confirming no active subprofiles or resources are still assigned to the department.
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
| (integer) | integer (int32) | Yes | The numeric ID of the department to delete. The request body is a raw integer value. |
42Response
200 OK
A successful deletion returns a 200 status with no response body payload. The absence of an error indicates the department was removed successfully.
{}Error Codes
| Code | When it happens |
|---|---|
| 400 | The request body is missing, malformed, or the department ID is not a valid integer |
| 401 | Token missing, expired, or invalid |
| 403 | Insufficient permissions to delete the specified department |
| 404 | No department found with the provided ID |
| 500 | Internal server error |
Common Mistakes
- Sending the department ID as a string (e.g.,
"42") instead of a raw integer (42) — the schema expects anint32type. - Attempting to delete a department that still has active subprofiles or resources assigned to it may result in a 400 error.
- Omitting the
Content-Type: application/jsonheader when sending the request body. - Reusing a deleted department ID in subsequent requests — once deleted, the ID is no longer valid and will return a 404.
Related Endpoints
GET /api/teams/departments— Retrieve a list of departmentsPOST /api/teams/departments— Create a new departmentPUT /api/teams/departments— Update an existing department
Example
curl -X DELETE https://api.banking.netevia.dev/api/teams/departments \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '42' 200Success
