Roles

Remove users from a role

Changed on

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.

delete/api/v1/roles/{roleid}/users

Request

Path parameters

roleidstring required

Id of the role to remove users from

Request body

userIdsstring[] required

Ids of the users to remove from the role

Example request

{
  "userIds": [
    "dotcms.org.2807"
  ]
}

Response

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

i18nMessagesMapobject
permissionsstring[]

Example response

{
  "entity": {
    "skipped": [
      {
        "userId": "dotcms.org.2807",
        "reason": "inherited"
      }
    ]
  }
}

Changes