Copy a custom role
POST/api/v1/RolesRole/:roleId/Copy
Creates a new role from an existing custom role. The copy keeps the permissions, scope and members of the original, but takes its name, description, target and all-items flags from the body, so send the role as it is returned by the get role route with a new name. Built-in roles cannot be copied.
Permission required: Administrator role.
Values for roleTarget: 0 = AccessPolicies, 1 = Credentials, 2 = Auditors.
Request
Responses
- 200
- 400
- 403
- 404
Returns the new role.
The IDs differ, the role is a built-in role, the new name is the same as the original or already in use, or the copy failed.
The signed-in user does not have the required role, or the account has read-only administrator access.
The role does not exist.