"cloneAccount"
(jsonAction)
Clone an existing account and its roles
The "cloneAccount"
action clones an existing account including its login properties and roles. It assigns a new name and a new password to the new account and optionally assigns new metadata.
Links: Concepts | Tutorials | FAQs
Request examples
{ "api": "admin", "action": "cloneAccount", "params": { "sourceUsername": "NewAccount1", "cloneUsername": "NewAccount3" }, "authToken": "replaceWithAuthTokenFromCreateSession" }
{ "api": "admin", "action": "cloneAccount", "params": { "sourceUsername": "NewAccount2", "cloneUsername": "NewAccount4", "clonePassword": "CorrectHorseBatteryStaple", "cloneRoles": true, "cloneDescription": "This account was cloned from NewAccount2.", "cloneMetadata": {} }, "requestId": "1", "authToken": "replaceWithAuthTokenFromCreateSession" }
The "cloneAccount" action clones an existing account and its roles, assigning a new name and password, and optionally new metadata. It requires specifying a source username, clone username, and clone password. Optional parameters include cloning roles, adding a description, and setting metadata. The "params" property contains these action parameters, with specific limits on string lengths and types for each property.
cloneAccount
cloneAccounts
clone account
API action
JSON ADMIN API
jsonAction
user management
account cloning
clone roles
user account creation
account duplication
admin actions
system administration
The "params"
property is an object that contains an action's parameters. Each action defines its own required and optional properties. See System limits for a comprehensive look at property requirements and limitations.
"params"
property summariesProperty | Description | Default | Type | Limits (inclusive) | ||
---|---|---|---|---|---|---|
specifies the source account to be cloned | Required - No default value | string | 1 to 31 bytes | |||
specifies the new name of the clone account | Required - No default value | string | 1 to 31 bytes | |||
specifies the code used to authenticate the clone account | Required - No default value | string | 1 to 63 bytes | |||
(optional) specifies whether the cloned account will also have the roles assigned to the source account |
| Boolean |
| |||
(optional) describes the clone account |
| string | ||||
(optional) contains user-defined properties that add keywords and tags about the clone account |
| object |
The "sourceUsername"
property is a required string up to 31 bytes long that specifies the source account to be cloned.
Note
See System limits for user name and other system properties requirements.
The "cloneUsername"
property is a required string up to 31 bytes long that specifies the new of name of the clone account.
Note
See System limits for user name and other system properties requirements.
The "clonePassword"
property is a required string up to 63 bytes long that specifies the code used to authenticate the clone account.
If it is set to an empty string, the server authenticates the account without a password. This is not recommended because it allows anyone to log into the account without supplying a password.
Note
See System limits for user name and other system properties requirements.
The "cloneRoles"
property is an optional Boolean that specifies whether the cloned account will also have the roles assigned to the source account.
If omitted, the clone will not have the same assigned roles as the source account.
The "cloneDescription"
property is an optional string up to 31 bytes long that specifies the "accountDescription"
for the clone account.
If omitted or set to
null
, an account description is not set.If present and set to a non-empty string, it is set to the new description.
If present and set to an empty string, it is set to the empty string.
The "cloneMetadata"
property contains user-defined properties that add keywords and tags about the clone account. The server indexes this field with a full-text index so you can search for any word or phrase to find the account.
In the clone account, the value in this property will become the value for the
"metadata"
property.