---
title: "Delete department by external code"
method: DELETE
path: "/os/v1/departments/{externalCode}"
tags: ["Department", "Department"]
---

# Delete department by external code

`DELETE /os/v1/departments/{externalCode}`

Deletes a department.

**Business Rules:**

• Department cannot be deleted if it is linked to active areas

## Path parameters

- `externalCode` string, required

## Response `204`

Department successfully deleted

## Other responses

- `400` — Bad Request - Department has active relationships (e.g. linked to areas)
- `401` — Unauthorized - Invalid or missing token
- `404` — Not Found - Department not found
- `500` — Internal Server Error - Unexpected failure

---

[API](https://skmtc.net/gupy/apis/gupy-public-api.md) · [All operations](https://skmtc.net/gupy/apis/gupy-public-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/gupy/gupy-public-api/versions/3f26defa2a42/schema)
