"assignRolesToAccounts"
(jsonAction)
Add and remove accounts from roles
Links: Concepts | Tutorials | FAQs
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" ] } ] }, "requestId": "1", "authToken": "replaceWithAuthTokenFromCreateSession" }
The "assignRolesToAccounts" API allows administrators to modify user account roles by adding or removing them. Requests use "params" with "add" and "remove" objects to specify roles and users. "Add" and "remove" properties are arrays of objects, each containing "rolenames" and "usernames". The summary table outlines these properties, their descriptions, defaults, types, and limitations for both adding and removing roles.
assignRolesToAccounts
assignRoleToAccount
assignRoleToAccounts
assignsRoleToAccount
assignsRolesToAccounts
assign role to account
admin API
API action
JSON ADMIN API
jsonAction
add user roles
remove user roles
user role management
role names
admin actions
"params"
property summariesProperty | Description | Default | Type | Limits (inclusive) | ||
---|---|---|---|---|---|---|
(optional) specifies which roles will be added to which accounts |
| array of objects | ||||
| (optional) specifies the roles to be added to the accounts |
| array | |||
| (optional) specifies which account will receive the roles |
| array | |||
(optional) specifies which roles will be added to which accounts |
| array of objects | ||||
| (optional) specifies the roles to be removed from the accounts |
| array | |||
| (optional) 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.