---
title: "Delete role by external code"
method: DELETE
path: "/os/v1/roles/external/{externalCode}"
tags: ["Role", "Role"]
---

# Delete role by external code

`DELETE /os/v1/roles/external/{externalCode}`

Soft-deletes a role identified by its external code for the company in the token.

**Business rules:**

• The role must exist for the company.

• The role cannot be deleted while it is linked to positions.

## Path parameters

- `externalCode` string, required

## Response `200`

Role successfully deleted

## Other responses

- `401` — Unauthorized - Invalid or missing token
- `409` — Conflict - Role not found for the company
- `422` — Unprocessable Entity - Role still has active relationships (e.g. positions)
- `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)
