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

# Remove users from a role

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

## Request

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

Bulk-removes the DIRECT membership of the given users from the role. The batch has PARTIAL-SUCCESS semantics: it never fails as a whole once the role resolves — every removable membership is removed and every other entry is reported in the skipped list with a reason: not_found (no user matches the id), inherited (the user is not a direct member — the membership is inherited through the role hierarchy, or the user is not a member at all; inherited membership can only be revoked by removing the user from the ancestor role that grants it), or error (unexpected per-user failure, logged server-side). Removals are committed per user, so entries already processed stay removed regardless of later entries. Only user-assignable roles (editUsers=true) accept membership changes: a role whose editUsers flag is false — e.g. a user's individual role or a system role — is rejected with 403 for the whole request, mirroring the grant endpoint.

## Path parameters

- `roleid` string, required

## Request body

- RoleUsersForm
  - `userIds` string[], required: Ids of the users to remove from the role

## Response `200`

Batch processed; removedUserIds and skipped report the per-user outcomes

- ResponseEntityRoleUsersRemovalView
  - `errors` ErrorEntity[]
    - `errorCode` string
    - `message` string
    - `fieldName` string
  - `entity` RoleUsersRemovalView
    - `removedUserIds` string[], required: Ids of the users whose direct membership in the role was removed
    - `skipped` SkippedUserView[], required: Users that could not be removed, each with a reason
      - `userId` string, required: Id of the skipped user, as submitted in the request
      - `reason` 'not_found' | 'inherited' | 'error', required: Why the user was skipped
  - `messages` MessageEntity[]
    - `message` string
  - `i18nMessagesMap` object
  - `permissions` string[]
  - `pagination` Pagination
    - `currentPage` integer
    - `perPage` integer
    - `totalEntries` integer

## Other responses

- `400`: Bad request - missing body, empty userIds, or null/blank entries
- `401`: Unauthorized - authentication required
- `403`: Forbidden - admin permissions required, or the role's editUsers flag is false
- `404`: Role not found

## 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/users/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)
