Remove a department

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

FieldTypeRequiredDescription
(integer)integer (int32)YesThe numeric ID of the department to delete. The request body is a raw integer value.
42

Response

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

CodeWhen it happens
400The request body is missing, malformed, or the department ID is not a valid integer
401Token missing, expired, or invalid
403Insufficient permissions to delete the specified department
404No department found with the provided ID
500Internal server error

Common Mistakes

  • Sending the department ID as a string (e.g., "42") instead of a raw integer (42) — the schema expects an int32 type.
  • 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/json header 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 departments
  • POST /api/teams/departments — Create a new department
  • PUT /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'
Body Params

Department id to delete

Headers
string
enum
Defaults to application/json

Generated from available request content types

Allowed:
Response
200

Success

Language
Credentials
Bearer
JWT
LoadingLoading…
Response
Click Try It! to start a request and see the response here!