"assignRolesToAccounts"
JSON ADMIN "assignRolesToAccounts"
action adds and removes accounts from roles
The "assignRolesToAccounts"
action adds and removes accounts from roles.
Request examples
{ "api": "admin", "action": "assignRolesToAccounts", "params": { "add": [ { "roleNames": [ "admin" ], "usernames": [ "NewAccount1", "NewAccount2" ] } ] }, "authToken": "replaceWithAuthTokenFromCreateSession" }
{ "api": "admin", "action": "assignRolesToAccounts", "params": { "add": [ { "roleNames": [ "admin" ], "usernames": [ "NewAccount1" ] } ], "remove": [ { "roleNames": [ "admin" ], "usernames": [ "NewAccount2" ] } ] }, "authToken": "replaceWithAuthTokenFromCreateSession", "requestId": "1" }
Use the assignRolesToAccounts API action to add and remove accounts from roles
Property | Description | Default | Type | Limits (inclusive) | ||
---|---|---|---|---|---|---|
specifies which roles will be added to which accounts |
| array of objects | ||||
| specifies the roles to be added to the accounts |
| array | |||
| specifies which account will receive the roles |
| array | |||
specifies which roles will be added to which accounts |
| array of objects | ||||
| specifies the roles to be removed from the accounts |
| array | |||
| specifies which accounts will receive the roles |
| array |
The "add"
property is an array of objects that specifies which roles will be added to which accounts. You can specify the roles you want to add with the "rolenames"
property and the accounts that will be assigned those roles with the "usernames"
property.
The "remove"
property is an array of objects that specifies which roles will be removed from which accounts. You can specify the roles you want to remove with the "rolenames"
property and the accounts to remove them from with the "usernames"
property.