---
title: "Create or update a manages relation"
method: PUT
path: "/v1/role/{parentRoleId}/manages"
tags: ["Manages"]
---

# Create or update a manages relation

`PUT /v1/role/{parentRoleId}/manages`

Create a manages relation (or update the existing one) between two roles<br><br>
        When a valid childRolePassword query parameter is specified, the call can be executed when the user is a member of an autorizing role which has direct or indirect roleManagement rights for the parent role of the newly created (or updated) manages relation.<br><br>
        When no childRolePassword query parameter is provided, a user can only execute this action if he is a member of an autorizing role which has:
        <ul>
          <li>
            direct or indirect roleManagement rights for the parent role of the newly created (or updated) manages relation
          </li>
          <li>
            *indirect* roleManagement rights for the child role of the newly created (or updated) manages relation
          </li>
        </ul>

## Path parameters

- `parentRoleId` integer, required

## Query parameters

- `childRoleId` integer, required
- `childRolePassword` string

## Request body

- Def26
  - `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

## Response `200`

The newly created (or updated) manages relation

- object
  - `manages` Def27
    - `id` integer, required — Id of the manages relation
    - `parentRoleId` integer, required — Id of the parent role
    - `childRoleId` integer, required — Id of the child role
    - `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

## Other responses

- `400` — Invalidly formatted body or query parameters
- `401` — Authentication required or token invalid
- `403` — User does not have appropriate role management rights
- `409` — The proposed manages relation cannot be added since it would create a cycle in the role graph
- `429` — The provided childRolePassword query parameter cannot be checked, since too many successive failed role query calls occured

---

[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)
