---
title: "Load users and roles by role ID"
method: GET
path: "/api/v1/roles/{roleid}/rolehierarchyanduserroles"
tags: ["Roles"]
---

# Load users and roles by role ID

`GET /api/v1/roles/{roleid}/rolehierarchyanduserroles`

## Request

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

Load the user and roles by role id with optional hierarchy and filtering

## Path parameters

- `roleid` string, required

## Query parameters

- `roleHierarchyForAssign` boolean
- `name` string

## Response `200`

Users and roles retrieved successfully

- ResponseEntityRoleListView
  - `errors` ErrorEntity[]
    - `errorCode` string
    - `message` string
    - `fieldName` string
  - `entity` Role[]
    - `id` string
    - `name` string
    - `description` string
    - `roleKey` string
    - `parent` string
    - `editPermissions` boolean
    - `editUsers` boolean
    - `editLayouts` boolean
    - `locked` boolean
    - `system` boolean
    - `roleChildren` string[]
    - `fqn` string
    - `dbfqn` string
    - `user` boolean
  - `messages` MessageEntity[]
    - `message` string
  - `i18nMessagesMap` object
  - `permissions` string[]
  - `pagination` Pagination
    - `currentPage` integer
    - `perPage` integer
    - `totalEntries` integer

## Other responses

- `400`: Bad request - invalid role ID
- `401`: Unauthorized - authentication required
- `403`: Forbidden - backend user required
- `404`: Role not found

## Changes

- **2026-10-30** `4fd8e917d458`: 6 info
  - api tag `Roles` added
  - added the non-success response with the status `400`
  - added the non-success response with the status `401`
  - added the non-success response with the status `403`
  - …2 more

[Operation history](https://skmtc.dev/anzworldline-solutions/apis/dotcms-rest-api/changes/api/v1/roles/:roleid/rolehierarchyanduserroles/get.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)
