Create a subaccount
This command allows you to create a subaccount.
All subaccounts will be created under the specified parent account.
The provided parent account ID must either be the authenticated token or a child account of the authenticated token.
For example, if Partner A provisions Customer Company B, they can also provision Employee C as a child of B by specifying B's account ID as the parent_account_id for C.
A subaccount can be created in two ways: by sending an activation email to the user or by setting a password, in which case the user will not receive an activation link via email.
API Request
Method POST
/users/{parent_account_id}/users
Elements schema
element user_create { element login { text } # If login contains a '@' and no separate email is supplied, login is used for primary email too & element password { text }? & element external_id { text }? & (element type { text } # AnonymousParent, PartnerParent, Administrator, User, Device, System; or User if not specified | element acl { text })? Expanded list of ACLs & element product { text }? # id of product assigned to account & element fullname { text }? # If supplied, primary contact full name & element email { text }? # If supplied, primary contact e-mail address & element country { text }? # ISO 3166-1 alpha-2 & element companyname { text }? # If supplied, primary contact company name & element zipcode { text }? # If supplied, primary contact zipcode & element language { text }? # RFC 1766 & element phone { text }? # If supplied, primary contact phone & element attributes { element attribute { element name { text } element value { text } }* }? & element captcha { text }? # If supplied, captcha response token, required if Capchaless ACL is missing }
Create a subaccount with email authentication required for account activation
This command creates a subaccount without a password. If no password is set during account creation, an activation link will be sent to the customer's email for account activation.
Example
Method POST
https://dk-co.keepit.com/users/nq2v51-5mx23m-qb7sah/users
Body
<user_create> <login>test@keepit.com</login> <fullname>TestAccount</fullname> <acl>MasterAdmin</acl> <language>en-GB</language> <product>a9y02y-qngj1m-yvh5r8</product> </user_create>
Additional information
- The login supplied (<login> field) will be used to create a user (access token) tied to the newly created account.
- The customer must activate their account using the link in the activation email once it is created. After activation, they will be ready to start setting up their backups.
Create a subaccount without email authentication for account activation
This command creates a subaccount with a password, bypassing the account activation requirement via email.
Example
Method POST
https://dk-co.keepit.com/users/nq2v51-5mx23m-qb7sah/users
Body
<user_create> <login>test@keepit.com</login> <password>12345679</password> <fullname>TestAccount</fullname> <acl>MasterAdmin</acl> <language>en-GB</language> <product>a9y02y-qngj1m-yvh5r8</product> </user_create>
PowerShell script
try { # Define the API credentials and user ID $username = '<API Token username>' $password = '<API Token password>' $userID = '<Account GUID>' # Create the Basic Authentication header $basicauth = [Convert]::ToBase64String([System.Text.Encoding]::ASCII.GetBytes("${username}:${password}")) $headers = @{ "User-Agent" = "PowerShell-Keepit-API-Agent-1.0" "Authorization" = "Basic $basicauth" "Content-Type" = "application/xml" } # Construct the URL with the user ID $url = "https://dk-co.keepit.com/users/$userID/users" # Define the XML body for creating a new user $xmlBody = @" <user_create> <login>test@keepit.com</login> <fullname>TestAccount</fullname> <acl>MasterAdmin</acl> <language>en-GB</language> <product>a9y02y-qngj1m-yvh5r8</product> </user_create> "@ # Send the POST request with the XML body Invoke-WebRequest -Uri $url -Method Post -Headers $headers -Body $xmlBody -ErrorAction Stop -TimeoutSec 10 } catch { # Handle errors and provide line number and error message $line = $_.InvocationInfo.ScriptLineNumber Write-Host "Cannot query Keepit API due to: $_" Write-Host "at line $line" }
The most commonly used ACLs:
- PartnerParent
- MSPPartner
- MasterAdmin
- BackupAdmin
- FullSupport
- LimitedSupport
- Audit
- StandardSupport
- SsoAdmin
- PMRAdmin
- ReadOnlySupport
Additional information
- The product ID must correspond to a product created in the portfolio of the creating account or one of its parent accounts.
- A primary contact record will be created for the new account, using the provided login as the email address and, if supplied, the full name.