cloneAccount

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.

 

Request examples

Minimal

{
  "action": "cloneAccount",
  "params": {
    "sourceUsername": "NewAccount1",
    "cloneUsername": "NewAccount3",
    "clonePassword": ""
  },
  "authToken": "replaceWithAuthTokenFromCreateSession"
}
 
 

Maximal

{
  "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"
}
 
 

 

Properties

Request properties ("params")

Property Description Default Type Limits (inclusive)

cloneDescription

The "cloneDescription" property 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.

 

Optional with default of "" string 0 to 31 bytes

cloneMetadata

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.
Optional with default of {} object 0 or more key/value pairs up to 65,500 bytes

clonePassword

The "clonePassword" property 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.

 

Required - No default value string 1 to 63 bytes

cloneRoles

The "cloneRoles" property 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.

 

Optional with default of true Boolean

true

false

cloneUsername

The "cloneUsername" property specifies the new of name of the clone account.

Note See System limits for user name and other system properties requirements.

 

Required - No default value string 1 to 31 bytes

sourceUsername

The "sourceUsername" property specifies the source account to be cloned.

Note See System limits for user name and other system properties requirements.

Required - No default value string 1 to 31 bytes