Create a subaccount

This command allows you to create a subaccount.

All subaccounts will be created under the specified parent account.

The token performing the command must belong to the parent account under which the subaccount will be created, or to an ancestor account higher in the hierarchy.

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.

When a subaccount is created, a user (primary token) is created. During the subaccount creation, it is optional to indicate the password for the user. The activation email is sent when there was no password indicated. In case the password was set, then no activation email is sent. 

API request

Method POST 

/users/{parent_account_id}/users

Elements table

Root object element: user_create

Element

Type

Requirement

Description

Additional Note

login

String

Mandatory

Primary user email. If no separate email is supplied, login will be used for primary email as well.

 

password

String

Optional

Primary user password. The activation email is sent in case no password is set.

 

external_id

String

Optional

External system ID.

Utility field for use by external provisioning systems.

acl

String

Optional

User role. Determines the token access and permissions.

 

Only one of two is applicable.

 

type

String

Optional

LEGACY. ACL element should be used instead. 

product

String

Optional

ID of product assigned to account

 

fullname

String

Optional

Primary contact full name

 

email

String

Optional

Primary contact email address

 

country

String

Optional

Country format in ISO 3166-1 alpha-2

 

companyname

String

Optional

Primary contact company name

 

zipcode

String

Optional

Primary contact ZIP code

 

language

String

Optional

Language in RFC 1766 format

 

phone

String

Optional

Primary contact phone

 

attributes

Object

Optional

Dictionary, optional text marking of the account

Container for one or more <attribute> elements

attribute

Object

Optional

Attribute entry

Child of <attributes>

name

String

Mandatory

Optional text marking name

Child of <attribute>

value

String

Mandatory

Optional text marking value

Child of <attribute>

captcha

String

Optional

Captcha response token. May be required for certain user roles.

 

Create a subaccount

Example of body:

<user_create> 
    <login>test@keepit.com</login> 
    <fullname>TestAccount</fullname> 
    <acl>MasterAdmin</acl> 
    <language>en-GB</language> 
    <product>a9y02y-qngj1m-yvh5r8</product> 
    <attributes>
        <attribute>
            <name>TestAttribute</name>
            <value>FirstAccount</value>
        </attribute>
    </attributes>
</user_create>

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>

Response

Code: 201 Created

PowerShell script

try { 
    $username = '<Token username>' 
    $password = '<Token password>' 
    $userID = '<Account GUID>'     

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

    $url = "https://dk-co.keepit.com/users/$userID/users" 

    $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> 
"@ 

    Invoke-WebRequest -Uri $url -Method Post -Headers $headers -Body $xmlBody -ErrorAction Stop -TimeoutSec 10 
} 
catch { 
    $line = $_.InvocationInfo.ScriptLineNumber 
    Write-Host "Cannot query Keepit API due to: $_" 
    Write-Host "at line $line" 
} 

The most commonly used ACLs (user roles):

  • PartnerParent
  • MSPPartner
  • MasterAdmin
  • BackupAdmin
  • FullSupport
  • LimitedSupport
  • Audit
  • StandardSupport
  • SsoAdmin
  • PMRAdmin
  • ReadOnlySupport

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>

Response

Code: 201 Created

PowerShell script

try { 
    $username = '<API Token username>' 
    $password = '<API Token password>' 
    $userID = '<Account GUID>' 

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

    $url = "https://dk-co.keepit.com/users/$userID/users"

$PrimaryTokenPassword = @"
EnterYourPasswordHere!
"@ 
    $xmlBody = @"
<user_create>
  <login>test@keepit.com</login>
  <password>$([System.Security.SecurityElement]::Escape($PrimaryTokenPassword))</password>
  <fullname>TestAccount</fullname>
  <acl>MasterAdmin</acl>
  <language>en-GB</language>
  <product>a9y02y-qngj1m-yvh5r8</product>
</user_create>
"@ 

    Invoke-WebRequest -Uri $url -Method Post -Headers $headers -Body $xmlBody -ErrorAction Stop -TimeoutSec 10 
} 
catch { 

    $line = $_.InvocationInfo.ScriptLineNumber 
    Write-Host "Cannot query Keepit API due to: $_" 
    Write-Host "at line $line" 
} 

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.
  • The password for the primary user (token), defined in the <password> element, should be enclosed with @" and "@ in the script to ensure proper handling of special characters. Replace the string “EnterYourPasswordHere!” with the password you wish to set.