---
title: "Collect roles (alternative of GET /v1/role)"
method: POST
path: "/v1/role/query"
tags: ["Role"]
---

# Collect roles (alternative of GET /v1/role)

`POST /v1/role/query`

Get all (or some of) the roles of which a user is a member (either directly or indirectly)

## Request body

- object
  - `filter` object — Only return those roles which match each of the specified filters
    - `viewId` integer — Only return those roles which have access to a specific view
    - `id` integer[] — Only return roles with one of the specified ids
    - `name` string[] — Only return roles with a name in this array
    - `ancestorRoleId` integer[] — Only return roles which are managed (directly or indirectly) by one of the specified ancestor role ids. Prefer the companyId filter
    - `companyId` integer[] — Only return roles which are directly or indirectly managed by one of the specified company ids
  - `userRights` Def28
    - `roleManagement` boolean — Indicates that the parent role has the right to attach the child role and its decendants to any other role.
    - `userManagement` boolean — Indicates that the parent role has the right to manage member relations for the child role and its decendants.
    - `viewManagement` boolean — Indicates that the parent role has the right to manage views relations for the child role and its decendants.
    - `deviceManagement` boolean — Indicates that the parent role has the right to manage monitors relations for the child role and its decendants.
    - `reportManagement` boolean — Indicates that the parent role has the right to manage "views report relations" for the child role and its decendants
    - `alarmManagement` boolean — Indicates that the parent role has the right to manage "alarm relations" for the child role and its decendants

## Response `200`

The roles of which the user is a member and which match all specified filters

- object
  - `role` Def34[]
    - `id` integer, required — Role id
    - `name` string, required — Role name
    - `selfRights` Def26, required
      - `roleManagement` boolean, required — Indicates that the parent role has the right to attach the child role and its decendants to any other role.
      - `userManagement` boolean, required — Indicates that the parent role has the right to manage member relations for the child role and its decendants.
      - `viewManagement` boolean, required — Indicates that the parent role has the right to manage views relations for the child role and its decendants.
      - `deviceManagement` boolean, required — Indicates that the parent role has the right to manage monitors relations for the child role and its decendants.
      - `reportManagement` boolean, required — Indicates that the parent role has the right to manage "views report relations" for the child role and its decendants
      - `alarmManagement` boolean, required — Indicates that the parent role has the right to manage "alarm relations" for the child role and its decendants
    - `userRights` Def28, required
      - `roleManagement` boolean — Indicates that the parent role has the right to attach the child role and its decendants to any other role.
      - `userManagement` boolean — Indicates that the parent role has the right to manage member relations for the child role and its decendants.
      - `viewManagement` boolean — Indicates that the parent role has the right to manage views relations for the child role and its decendants.
      - `deviceManagement` boolean — Indicates that the parent role has the right to manage monitors relations for the child role and its decendants.
      - `reportManagement` boolean — Indicates that the parent role has the right to manage "views report relations" for the child role and its decendants
      - `alarmManagement` boolean — Indicates that the parent role has the right to manage "alarm relations" for the child role and its decendants

## Other responses

- `400` — Invalidly formatted body
- `401` — Authentication required or token invalid

---

[API](https://skmtc.dev/eniris/apis/eniris-metadata-telemetry-query-api.md) · [All operations](https://skmtc.dev/eniris/apis/eniris-metadata-telemetry-query-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/eniris/eniris-metadata-telemetry-query-api/revisions/fe3723575e19/schema)
