"assignRolesToAccounts" (JSON Action)
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.
"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 | 1 or more strings, each between 1 and 64 bytes. | ||
| (optional) specifies which account will receive the roles. |
| array | 1 or more strings, each between 1 and 64 bytes. | ||
(optional) specifies which roles will be added to which accounts. |
| array of objects |
| |||
| (optional) specifies the roles to be removed from the accounts. |
| array | 1 or more strings, each between 1 and 64 bytes. | ||
| (optional) specifies which accounts will receive the roles. |
| array | 1 or more strings, each between 1 and 64 bytes. |
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 "roleNames" property specifies the roles to be added to or deleted from the accounts specified by the "usernames" property. This property can specify one or more roles, each between 1 and 64 bytes.
"add": [
{
"roleNames": [
"admin"
],
"usernames": [
"NewAccount1"
]
}
]The "usernames" property specifies which accounts the roles specified by the "roleNames" property should be added to or deleted from. This property can specify one or more roles, each between 1 and 64 bytes
"add": [
{
"roleNames": [
"admin"
],
"usernames": [
"NewAccount1"
]
}
]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.
The "roleNames" property specifies the roles to be added to or deleted from the accounts specified by the "usernames" property. This property can specify one or more roles, each between 1 and 64 bytes.
"add": [
{
"roleNames": [
"admin"
],
"usernames": [
"NewAccount1"
]
}
]The "usernames" property specifies which accounts the roles specified by the "roleNames" property should be added to or deleted from. This property can specify one or more roles, each between 1 and 64 bytes
"add": [
{
"roleNames": [
"admin"
],
"usernames": [
"NewAccount1"
]
}
]