---
title: "Delete a role"
method: DELETE
path: "/api/v1/roles/{roleid}"
tags: ["Roles"]
---

# Delete a role

`DELETE /api/v1/roles/{roleid}`

## Request

- Base URL: `https://docs.anzworldline-solutions.com.au`
- URL: `https://docs.anzworldline-solutions.com.au/api/v1/roles/{roleid}`
- Auth: none declared
- TypeScript: <https://skmtc.dev/anzworldline-solutions/apis/dotcms-rest-api/docs/api/v1/roles/:roleid/delete.ts> (a function with typed inputs; its response is checked against the schema)

Deletes a role. The deletion CASCADES and is not reversible: the role is removed from all users that have it, all permissions granted to the role are deleted, and its layout (tool-group) assignments are detached. The response reports how many users were affected. Deletion is rejected when the role has child roles or is referenced by a workflow action's Assign To (409), and for system or locked roles (403).

## Path parameters

- `roleid` string, required

## Response `200`

Role deleted successfully; usersAffected reports the cascade blast radius

- ResponseEntityRoleDeletionView
  - `errors` ErrorEntity[]
    - `errorCode` string
    - `message` string
    - `fieldName` string
  - `entity` RoleDeletionView
    - `deleted` boolean, required: Whether the role was deleted
    - `roleId` string, required: Id of the deleted role
    - `usersAffected` integer, required: Number of users the role was removed from by the cascading deletion. Counts direct assignments only; users inheriting the role through the role hierarchy are not included
  - `messages` MessageEntity[]
    - `message` string
  - `i18nMessagesMap` object
  - `permissions` string[]
  - `pagination` Pagination
    - `currentPage` integer
    - `perPage` integer
    - `totalEntries` integer

## Other responses

- `401`: Unauthorized - authentication required
- `403`: Forbidden - admin permissions required, or the role is a system or locked role
- `404`: Role not found
- `409`: Conflict - the role has child roles, or a workflow action references it

## Changes

- **2026-10-30** `4fd8e917d458`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/anzworldline-solutions/apis/dotcms-rest-api/changes/api/v1/roles/:roleid/delete.md)

---

[API](https://skmtc.dev/anzworldline-solutions/apis/dotcms-rest-api.md) - [All operations](https://skmtc.dev/anzworldline-solutions/apis/dotcms-rest-api/llms.txt) - [OpenAPI document](https://skmtc.dev/anzworldline-solutions/apis/dotcms-rest-api/revisions/4fd8e917d458?raw)
