API Documentation

Element

Type

Requirement

Description

Additional Note

aname

Text

Optional

Token email

 

apass

Text

Optional

Token password

 

descr

Text

Optional

Short textual description of the token (e.g., name of device)

 

lifetime

ISO 8601 Period

Optional

Lifetime of the token

If not provided, token lifetime is unlimited

expires

Timestamp

Optional

Date and time when token will expire.

Format: `YYYY-MM-DDTHH:MM:SSZ` (ISO 8601)

type

Text

Optional

LEGACY. ACL element should be used instead.

 

Only one of two is applicable

acl

Text

Optional

User role. Determines the token access and permissions. List of user roles can be found below.

Change token permissions and other details

Example

Method PUT

https://dk-co.keepit.com/users/5t1sbe-s6zsgx-rtutxq/tokens/test@keepit.com

Body

<token_update>
    <acl>FullSupport</acl>
</token_update>

Response

Code: 200 OK

Response body:

Successfully updated access token.

PowerShell script

try {
    $username = '<API Token username>'
    $password = '<API Token password>'
    $hostname = 'dk-co.keepit.com'
    $userId = '<Account GUID>'

    $tokenAname = 'test111@keepit.com'
    $acl = 'FullSupport'

    $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://$hostname/users/$userId/tokens/$tokenAname"

 
    $xmlBody = @"
<token_update>
    <acl>$acl</acl>
</token_update>

"@


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


Script result

Successfully updated access token.

Additional information

  • To clear the token's lifetime, send a request with an empty <lifetime> field.
  • However, during an update operation, the absence of a <lifetime> element means that the existing value remains unchanged. The same behavior applies to the <expires> element.

The most commonly used ACLs

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