Sassafras logo

Sassafras REST API (v2)

Download OpenAPI specification:Download

Overview

The Sassafras REST API provides programmatic access to settings and objects on Sassafras AllSight, LabSight, and KeySight servers.

This document provides information on the REST methods and resources for version 2 of the API. The API should be used for basic querying of the data, and not for bulk or heavy-use data retrieval. There are currently other more efficient mechanisms for processes that require full data capture or continual bulk data access.

The easiest way to test the API is to use a program like curl, although for GET-based methods a browser will be sufficient. Tools like Postman are useful for more advanced API testing.

URI Pattern and the Resource Hierarchy

All REST APIs are intended to provide access to resources using predictable and consistent URIs. Clients of a REST API submit HTTP requests and receive the results of the request in well-defined formats. Each request operates on the specified resource according to the request's HTTP method, which can be one of GET, PUT, POST, PATCH, and DELETE. A REST API request URI follows the pattern:

https://server.sample.net/api/v2/resource-path?arguments

The resource-path gives the path to a unique resource. Requests can be made on resources at each level of the hierarchy, and the response will list the resources contained at that level. For example, a request made for the URI:

https://server.sample.net/api/v2

would return the resources available within version 2 of the API. When a request is made for a resource that is not a container, the response has just the single resource.

The arguments in the URI can supply:

  • a query filter for selecting resources
  • a list of fields that should be returned in the response
  • other directives specific to the request

Response fields and query filters are covered below.

Request and Response Formats

When POSTing data, the commonly accepted format is JSON, although certain endpoints expect plain text or raw data. Requests should include a Content-Type header that indicates the actual format used, for example application/json for JSON formatted request bodies. With curl you can do this as follows:

curl --header "Content-Type: application/json" https://server.sample.net/api/v2/...

Responses will be formatted as JSON for most endpoints, although certain resource endpoints have different format types as appropriate. The response will always include a Content-Type header to indicate the format.

Responses with Content-Type application/json conform to a simple schema that supports individual objects and arrays of objects, where each object contains properties corresponding to the requested fields in addition to the resource ID and type.

When the response contains multiple resources, the resources are sent as members of a JSON array.

[
    { resource fields... },
    { resource fields... },
    ...
]

Responses with just one resource are sent without an enclosing array.

{
    resource fields...
}

Response Fields

Response data contains the resource ID and type by default. To receive other attributes of the resource, the attribute field names are given in the fields=... argument. Field names vary depending on the resource type, but all resources have ident and type fields. The ident can be used to request resources within the containing resource.

https://server.sample.net/api/v2/computer

This query would return a response listing all the sub-resources within the computer resource:

[
    { "ident":"items", "type":"topic" },
    { "ident":"sections", "type":"topic" },
    { "ident":"divisions", "type":"topic" },
    { "ident":"schema", "type":"topic" }
]

The list in the response gives resources that we can request within the computer resource. By default, list responses like this will only return the ident and type fields. To retrieve fields other than these, include the field names in the fields argument.

For leaf resources that do not contain other resources, the response will be a single object instead of a list of objects. In the next example we also include a fields argument, with field names separated by commas. The fields are specific to the resource type, product in this case:

https://server.sample.net/api/v2/product/items/5A55ADEF383F4E8798073862A18D3433?fields=Name,Version,Publisher

When a URI includes a fields argument, those fields will be included in the resource record (the ident and type fields are always included):

{
    "ident": "5A55ADEF383F4E8798073862A18D3433",
    "type": "product",
    "Name": "Microsoft Office 2008 for Mac Standard Edition",
    "Version": "2008",
    "Publisher": "Microsoft Corporation"
}

By default, a response with a single leaf resource will contain many fields other than ident and type. In this case, the fields argument can be used to reduce this default field set to just those that are required by the particular request. Furthermore, some resources have fields that are costly to gather and return. Such costly fields will only be included in the result when they are requested in the fields argument.

Valid field names for each resource type are listed in the description of each endpoint below, and also can be retrieved from the associated schema endpoints.

Query Filters

Endpoints that return a list of resources support a query filter that selects the set of resources that will be returned. Query filters use a typical format that includes common comparison and logical operators. Any top-level field defined for the resource type of the target endpoint can be used in the query filter. The query filter is provided in the query=... argument.

For example, a simple query filter on the computer/items endpoint can select just those computers that are in a particular division:

(Division="Some Division")

On the product/items endpoint, all products that are installed on at least 100 computers:

(InstallCount>=100)

On the report/items endpoint, the list of reports that were created more recently than a certain date:

(created>=@20220925000000Z)

Note the variations in syntax in these three examples. In the first example, since we are comparing with text string, that value is within quotation marks (it is valid to use either single or double quotation marks, as long as they are consistent). The second example is comparing a number, so there are no quotations marks around the value. The date in the third example demonstrates the required format: @YYYYMMDDhhmmssZ. Dates can be specified as UTC (suffix Z), or within a time zone (e.g., @20220925123000-0400, generally @YYYYMMDDhhmmss[+-]hhmm).

To test for non-zero or non-empty values, just use the field name:

(Anchored)

In addition to the usual comparison operators, there some useful substring operators available. In all cases the order of the operands is important: the string to be searched for on the left, the string to search on the right.

String prefix: ("needle"*=Haystack)

String suffix: ("needle"%=Haystack)

String containment: ("needle"~=Haystack)

All string comparisons and searches are case-insensitive.

More complex query filters can be built using logical operators. Use parentheses to indicate the order of operations. This query filter on the computer/items endpoint looks for all computers in the "Second Floor" division that are enabled for audits but have not audited since a certain date:

(Division='Second Floor')&&(Audited)&&(LastAudit<@20220925000000-0400)

Complex query filters can also use logical or || and negation !.

Case Insensitive Field Names

The API treats all field keys in a case-insensitive way. This means if you use a field like "Name" in a request body or in a query filter, it will be the same as if you had used "name" or "NAME". The field keys that are returned in responses will match how they were specified in the request's field parameter. If you send a request with fields=name, the response will include that field with the key "name". If you do not specify the field key but the field still appears in the response (e.g., with a GET request on a non-container resource when no fields parameter is given), the field key will use a consistent case from one request to another.

Although the API treats field keys as case-insensitive on the server side, many client-side environments (like JavaScript) are case-sensitive, so you must use the proper cases when referencing fields. The best way to ensure that you get the casing you require is to use the fields parameter to explicitly request the fields you will be using. Otherwise, make a test query to the endpoint to determine what the default casing is for a particular field, and use that.

Performance Considerations

Requests to endpoints that return a list of resources are expensive for the server to process. Every resource in the list must be loaded from the data, tested, and formattted for the resulting response. If you are making frequent requests to a list endpoint you should consider using the Bulk Query endpoints or other mechanisms that are more suited to bulk data retrieval, or that incorporate caching.

See the documentation for Scripting, ksODBC, ksJDBC, and exporting.

Requests to leaf endpoints that return a single object are more efficient (unless you make many many such requests), although requesting a full object with complex sub-fields creates additional server load. It is always best to request just those fields that are actually needed and consider caching the response data.

While it is possible to get all data for all objects in one query, making such a large request can be wasteful of server resources especially if the intent is to use only part of the data. It is best to request just the fields that are necessary for the task, and use a filter to reduce the number of items returned. If the query is being used to locate just one object, perhaps by name, it is best to search for the matching object once and cache the ID, then in subsequent queries use the ID to get the object directly.

Rate Limiting

Servers can be configured to limit the number of REST API calls that can be made over some period of time. When a request would cause this limit to be exceeded, it will fail with error code 429. The Retry-After header will indicate the number of seconds to wait before making the request again. Note that this rate limit is independent of who is making the request -- the same limit is shared and used by all accounts.

In most cases (and particularly for cloud-hosted servers) the primary purposes for the rate limit are to prevent abuse and curtail brute-force attacks. If your use of the REST API is significantly constrained by the rate limit, it is possible to increase the limit. If the server is self-hosted, the configuration can be changed by any admin with sufficient privileges. If the server is cloud-hosted by Sassafras, the limit can only be raised by contacting Sassafras Software.

Authorization

The Sassafras REST API uses access tokens to authenticate and authorize requests. Access tokens are passed in the Authorization header of each API request as Bearer tokens.

For development and testing, it is possible to use HTTP Basic Auth for API requests. This option is not intended for production use since the account name and password must be provided to the code that is making the requests, and there is no mechanism for limiting the priviliges beyond what the account holds.

Access tokens represent the permissions granted to the account that created them, so it is important to store and use them securely. All API requests should be made over HTTPS in order to ensure the privacy of access tokens. Keeping access tokens secure is your responsibility.

When API calls are made within a web page, authentication can use existing credentials held by the browser (provided the user has connected to and authenticated with the API host server via the Web UI).

All API requests must have an Authorization header with valid credentials. When credentials are not present or invalid a 4xx level status response will be returned. A 4xx level status will also be returned when credentials are valid but the account does not have permission for the requested endpoint or resource.

See the following section on Token Endpoints for information on creating access tokens.

Token Endpoints

You can create an access token in the Web UI by selecting View Account or Edit Account from the account menu in the upper right of any page. Click the Get Access Token button, provide the requested information, click Create, and copy the resulting access token.

Each access token represents the permissions that have been granted to the account that created it. If the permissions for the account change, the access token will adopt these changes. An access token can contain a permissions scope that places further restrictions on the account's permissions. An access token's permission scope cannot add new permissions, it can only restrict the permissions held by the account.

An access token has a limited lifetime, after which it will no longer be valid. Furthermore, any internal account's previously issued access tokens can be immediately invalidated by changing that account's password.

With existing credentials (for example, an access token created within the Web UI), new access tokens can be created to extend API access into the future, or apply additional restrictions.

Get an access token

Create a new access token with a set expiration

Authorizations:
BearerBasic
Request Body schema: application/json

token parameters

lifetime
integer <int32>

token lifetime in seconds

scope
string

Responses

Request samples

Content type
application/json
{
  • "lifetime": 86400
}

Response samples

Content type
application/json
{
  • "lifetime": 86400,
  • "token": "eyJ0eXAiOiJqd3QiLC..."
}

Container Endpoints

In support of API discovery, every container endpoint supports the GET method, which returns the list of topic endpoints within that container. Use the topic lists to browse through all the endpoints that are available (provided your account has the appropriate permissions). Note that some endpoints are not documented here. These endpoints are used internally, and might change without warning. If an undocumented endpoint looks like it might be of use to you, please contact Sassafras Software to discuss your use case.

List Topics

Authorizations:
BearerBasic
path Parameters
container-path
required
string
Examples:
  • - Root Container
  • computer - Computer Container
  • product - Product Container

relative path of the container

query Parameters
fields
string
Example: fields=name

optional fields to include in response

query
string

optional filter for list results

Responses

Response samples

Content type
application/json
[
  • {
    },
  • {
    }
]

Computer Endpoints

Computer records are created for all computers that have the KeyAccess client software installed. Computer records can also be created by importing information from other sources such as Intune and Jamf, or by creating them with scripts or API calls. Computer IDs can be based on a MAC address, hardware serial number, computer name, or other quasi-unique system properties. The client determines the ID of a computer by stepping through an ordered list of "ID Types", using the first ID type that has a valid value for that computer's ID. Computer records that are imported or otherwise created without a client can use whichever ID makes the most sense. If the source data has the serial number of a computer, that is the recommended choice for the ID.

Computer records are not just created for physical hardware. For licensing purposes a computer record is also created for Thin-client connections so an RDP server that has the client installed. Computer records are also create for virtual computer instances that have the client installed.

While it is possible to delete Computer records, it is often best to leave them in the data and use the Login type or Lifecycle Stage to mark them as uninteresting. If the computer has the client software installed, the matching computer record will be recreated the next time the client on that computer communicates with the server. Deleting a computer record also removes some of the data that was collected for that computer, and removes that computer from various usage reporting. Such historical data might prove useful even once the computer has been removed from service.

List Computers

Retrieve a list of all computers that match an optional filter provided in the query parameter.

Authorizations:
BearerBasic
query Parameters
fields
string
Example: fields=name

optional fields to include in response

query
string

optional filter for list results

Responses

Response samples

Content type
application/json
[
  • {
    },
  • {
    }
]

Create Computer

Create a new computer

Authorizations:
BearerBasic
Request Body schema: application/json

computer to create

ident
string

unique ID of the object

type
string

type of this object

Name
string
Array of objects (ComputerDeviceList)
Array of objects (DocumentList)
...
any

see /api/v2/computer/schema/items for full list of properties

Responses

Request samples

Content type
application/json
{
  • "ident": "B2359823495",
  • "name": "SFCN-OPS-8563"
}

Get Computer

Retrieve the properties of an existing computer.

Authorizations:
BearerBasic
path Parameters
computer-id
required
string
Example: B2359823495

ID of the computer

query Parameters
fields
string
Example: fields=name

optional fields to include in response

Responses

Response samples

Content type
application/json
{
  • "type": "computer",
  • "ident": "B2359823495"
}

Modify Computer

Modify the properties of an existing computer

Authorizations:
BearerBasic
path Parameters
computer-id
required
string
Example: B2359823495

ID of the computer

Request Body schema: application/json

computer properties

ident
string

unique ID of the object

type
string

type of this object

Name
string
Array of objects (ComputerDeviceList)
Array of objects (DocumentList)
...
any

see /api/v2/computer/schema/items for full list of properties

Responses

Request samples

Content type
application/json
{
  • "name": "SFCN-OPS-8563"
}

Delete Computer

Remove an existing computer from the server's database.

Authorizations:
BearerBasic
path Parameters
computer-id
required
string
Example: B2359823495

ID of the computer

Responses

List Device Associations

Retrieve a list of all devices associated with a computer.

Authorizations:
BearerBasic
path Parameters
computer-id
required
string
Example: B2359823495

ID of the computer

Responses

Response samples

Content type
application/json
[
  • {
    },
  • {
    }
]

Add Device Associations

Associate devices with a computer.

Authorizations:
BearerBasic
Request Body schema: application/json

device(s) to associate with this computer

One of
deviceid
string
date
string <date-time>

Responses

Request samples

Content type
application/json
{
  • "name": "379F443E11094D5BBD103C06FA6B4A8D",
  • "last": "2022-08-25T12:34:56.000Z"
}

Remove Device Associations

Remove device associations from a computer.

Authorizations:
BearerBasic
path Parameters
computer-id
required
string
Example: B2359823495

ID of the computer

Request Body schema: application/json

device associations to remove

Array
string

Responses

Request samples

Content type
application/json
[
  • "379F443E11094D5BBD103C06FA6B4A8D",
  • "75992E583801C621A0124C56A23ED0E5"
]

Get Device Association

Retrieve information about a device associated with a computer.

Authorizations:
BearerBasic
path Parameters
computer-id
required
string
Example: B2359823495

ID of the computer

device-id
required
string
Example: 379F443E11094D5BBD103C06FA6B4A8D

ID of the device

Responses

Response samples

Content type
application/json
{
  • "deviceid": "379F443E11094D5BBD103C06FA6B4A8D",
  • "last": "2022-08-25T12:34:56.000Z"
}

Modify a Device Association

Modify information about a device associated with a computer

Authorizations:
BearerBasic
path Parameters
computer-id
required
string
Example: B2359823495

ID of the computer

device-id
required
string
Example: 379F443E11094D5BBD103C06FA6B4A8D

ID of the device

Request Body schema: application/json

device information

deviceid
string
date
string <date-time>

Responses

Request samples

Content type
application/json
{
  • "last": "2022-09-25T12:34:56.000Z"
}

Remove a Device Association

Remove a device association from a computer.

Authorizations:
BearerBasic
path Parameters
computer-id
required
string
Example: B2359823495

ID of the computer

device-id
required
string
Example: 379F443E11094D5BBD103C06FA6B4A8D

ID of the device

Responses

List Document References

Retrieve a list of all documents for a computer.

Authorizations:
BearerBasic
path Parameters
computer-id
required
string
Example: B2359823495

ID of the computer

Responses

Response samples

Content type
application/json
[
  • {
    },
  • {}
]

Add Document References

Reference documents for a computer. Use this endpoint to reference web links for a computer. To store files on the server, use the /api/v2/computer/documents/{computer-id} endpoint, which will automatically add a reference for the document.

Authorizations:
BearerBasic
Request Body schema: application/json

document(s) to reference

One of
name
string
date
string <date-time>
url
string
file
string
store
string

Responses

Request samples

Content type
application/json
{}

Remove Document References

Remove documents for a computer.

Authorizations:
BearerBasic
path Parameters
computer-id
required
string
Example: B2359823495

ID of the computer

Request Body schema: application/json

documents to remove

Array
string

Responses

Request samples

Content type
application/json
[
  • "manifest-20220925.txt",
  • "AdvanceTech PowerTower 2000"
]

Get a Document Reference

Retrieve the information about a document for a computer.

Authorizations:
BearerBasic
path Parameters
computer-id
required
string
Example: B2359823495

ID of the computer

document-id
required
string
Example: invoice-634259.pdf

ID of the document

Responses

Response samples

Content type
application/json
{
  • "name": "manifest-20220925.txt",
  • "date": "2022-08-25T12:34:56.000Z",
  • "file": "/api/v2/computer/documents/B2359823495/manifest-20220925.txt",
  • "store": "ks-store:///maid/B2359823495/manifest-20220925.txt"
}

Modify a Document Reference

Modify the information about a document for a computer

Authorizations:
BearerBasic
path Parameters
computer-id
required
string
Example: B2359823495

ID of the computer

document-id
required
string
Example: invoice-634259.pdf

ID of the document

Request Body schema: application/json

document information

name
string
date
string <date-time>
url
string
file
string
store
string

Responses

Request samples

Content type
application/json
{
  • "date": "2022-09-25T12:34:56.000Z"
}

Remove a Document Reference

Remove the information about a document for a computer.

Authorizations:
BearerBasic
path Parameters
computer-id
required
string
Example: B2359823495

ID of the computer

document-id
required
string
Example: invoice-634259.pdf

ID of the document

Responses

List Stored Documents

Retrieve a list of all documents saved for a computer.

Authorizations:
BearerBasic
query Parameters
fields
string
Example: fields=name

optional fields to include in response

query
string

optional filter for list results

Responses

Response samples

Content type
application/json
[
  • {
    },
  • {
    }
]

Store a Document

Upload a document to the store for this computer. A document reference will also be added to the computer record.

Authorizations:
BearerBasic
Request Body schema: content-type

document to upload

any

file data with specified content type

Responses

Get Stored Document

Retrieve the stored document.

Authorizations:
BearerBasic
path Parameters
computer-id
required
string
Example: B2359823495

ID of the computer

document-id
required
string
Example: invoice-634259.pdf

ID of the document

Responses

Delete Stored Document

Remove an existing document. Any reference to the document will be removed from the computer record.

Authorizations:
BearerBasic
path Parameters
computer-id
required
string
Example: B2359823495

ID of the computer

document-id
required
string
Example: invoice-634259.pdf

ID of the document

Responses

Device Endpoints

Device records are created for certain devices discovered by the KeyAccess client on a computer. Device records can also be created by importing information from other sources such as Intune and Jamf, or by creating them with scripts or API calls. Device IDs are derived from a device's unique serial number.

List Devices

Retrieve a list of all devices that match an optional filter provided in the query parameter.

Authorizations:
BearerBasic
query Parameters
fields
string
Example: fields=name

optional fields to include in response

query
string

optional filter for list results

Responses

Response samples

Content type
application/json
[
  • {
    },
  • {
    }
]

Create Device

Create a new device

Authorizations:
BearerBasic
Request Body schema: application/json

device to create

ident
string

unique ID of the object

type
string

type of this object

Name
string
Array of objects (DocumentList)
...
any

see /api/v2/device/schema/items for full list of properties

Responses

Request samples

Content type
application/json
{
  • "ident": "75992E583801C621A0124C56A23ED0E5",
  • "name": "DELL UP3214Q"
}

Get Device

Retrieve the properties of an existing device.

Authorizations:
BearerBasic
path Parameters
device-id
required
string
Example: 379F443E11094D5BBD103C06FA6B4A8D

ID of the device

query Parameters
fields
string
Example: fields=name

optional fields to include in response

Responses

Response samples

Content type
application/json
{
  • "type": "device",
  • "ident": "75992E583801C621A0124C56A23ED0E5"
}

Modify Device

Modify the properties of an existing device

Authorizations:
BearerBasic
path Parameters
device-id
required
string
Example: 379F443E11094D5BBD103C06FA6B4A8D

ID of the device

Request Body schema: application/json

device properties

ident
string

unique ID of the object

type
string

type of this object

Name
string
Array of objects (DocumentList)
...
any

see /api/v2/device/schema/items for full list of properties

Responses

Request samples

Content type
application/json
{
  • "name": "DELL UP3214Q"
}

Delete Device

Remove an existing device from the server's database.

Authorizations:
BearerBasic
path Parameters
device-id
required
string
Example: 379F443E11094D5BBD103C06FA6B4A8D

ID of the device

Responses

List Document References

Retrieve a list of all documents for a device.

Authorizations:
BearerBasic
path Parameters
device-id
required
string
Example: 379F443E11094D5BBD103C06FA6B4A8D

ID of the device

Responses

Response samples

Content type
application/json
[
  • {
    },
  • {}
]

Add Document References

Reference documents for a device. Use this endpoint to reference web links for a device. To store files on the server, use the /api/v2/device/documents/{device-id} endpoint, which will automatically add a reference for the document.

Authorizations:
BearerBasic
Request Body schema: application/json

document(s) to reference

One of
name
string
date
string <date-time>
url
string
file
string
store
string

Responses

Request samples

Content type
application/json
{}

Remove Document References

Remove documents for a device.

Authorizations:
BearerBasic
path Parameters
device-id
required
string
Example: 379F443E11094D5BBD103C06FA6B4A8D

ID of the device

Request Body schema: application/json

documents to remove

Array
string

Responses

Request samples

Content type
application/json
[
  • "manifest-20220925.txt",
  • "AdvanceTech PowerTower 2000"
]

Get a Document Reference

Retrieve the information about a document for a device.

Authorizations:
BearerBasic
path Parameters
device-id
required
string
Example: 379F443E11094D5BBD103C06FA6B4A8D

ID of the device

document-id
required
string
Example: invoice-634259.pdf

ID of the document

Responses

Response samples

Content type
application/json
{
  • "name": "manifest-20220925.txt",
  • "date": "2022-08-25T12:34:56.000Z",
  • "file": "/api/v2/device/documents/B2359823495/manifest-20220925.txt",
  • "store": "ks-store:///papr/B2359823495/manifest-20220925.txt"
}

Modify a Document Reference

Modify the information about a document for a device

Authorizations:
BearerBasic
path Parameters
device-id
required
string
Example: 379F443E11094D5BBD103C06FA6B4A8D

ID of the device

document-id
required
string
Example: invoice-634259.pdf

ID of the document

Request Body schema: application/json

document information

name
string
date
string <date-time>
url
string
file
string
store
string

Responses

Request samples

Content type
application/json
{
  • "date": "2022-09-25T12:34:56.000Z"
}

Remove a Document Reference

Remove the information about a document for a device.

Authorizations:
BearerBasic
path Parameters
device-id
required
string
Example: 379F443E11094D5BBD103C06FA6B4A8D

ID of the device

document-id
required
string
Example: invoice-634259.pdf

ID of the document

Responses

List Stored Documents

Retrieve a list of all documents saved for a device.

Authorizations:
BearerBasic
query Parameters
fields
string
Example: fields=name

optional fields to include in response

query
string

optional filter for list results

Responses

Response samples

Content type
application/json
[
  • {
    },
  • {
    }
]

Store a Document

Upload a document to the store for this device. A document reference will also be added to the device record.

Authorizations:
BearerBasic
Request Body schema: content-type

document to upload

any

file data with specified content type

Responses

Get Stored Document

Retrieve the stored document.

Authorizations:
BearerBasic
path Parameters
device-id
required
string
Example: 379F443E11094D5BBD103C06FA6B4A8D

ID of the device

document-id
required
string
Example: invoice-634259.pdf

ID of the document

Responses

Delete Stored Document

Remove an existing document. Any reference to the document will be removed from the device record.

Authorizations:
BearerBasic
path Parameters
device-id
required
string
Example: 379F443E11094D5BBD103C06FA6B4A8D

ID of the device

document-id
required
string
Example: invoice-634259.pdf

ID of the document

Responses

Product Endpoints

Products are the primary object for recording software usage and gathering software audits. Products typically contain one or more executable programs, which are tracked by the client software when gathering usage data. Web Products reference URLs instead of executable programs for tracking browser activity. Products can also contain information for fonts as a way to audit where fonts are installed. Finally, a set of related products can be gathered into a family product for use in aggregating usage and audit information.

Products are automatically imported into a server based on what software has been discovered on the clients of that server. The information about these products is retrieved from Sassafras's Product Recognition Service (PRS), a collection of over 15,000 software products that is maintained and updated by Sassafras. The core definition of products imported from PRS should not be changed, since those changes can be removed if the products are re-imported for any reason. The core definition includes the programs, packages, fonts, URLs, and editions/families that make up the product; the product Name, Version, and Publisher; various other PRS-supplied information like Description and Category. There are non-core properties that are intended for customization and can be changed without issue, such as Web Description, External URL, External ID, Notes, and Tags. Of course any manual products created specifically on a server can be defined and changed as needed and will not be altered by PRS imports.

List Products

Retrieve a list of all products that match an optional filter provided in the query parameter.

Authorizations:
BearerBasic
query Parameters
fields
string
Example: fields=name

optional fields to include in response

query
string

optional filter for list results

Responses

Response samples

Content type
application/json
[
  • {
    },
  • {
    }
]

Create Product

Create a new product

Authorizations:
BearerBasic
Request Body schema: application/json

product to create

ident
string

unique ID of the object

type
string

type of this object

Name
string
Publisher
string
Version
string
Platform
string
Category
string
Description
string
Address
string
Array of objects

Expensive The list of program variants in this product (for product editions)

Array of objects

Expensive The list of packages in this product (for product editions)

Array of objects

Expensive The list of products in this family (for product families)

Array of objects

Expensive The list of families that contain this product (for product editions)

Array of objects

Expensive The list of policies that cover this product

...
any

see /api/v2/product/schema/items for full list of properties

Responses

Request samples

Content type
application/json
{
  • "ident": "A31B980EAA3B4E33BD50E0C0A0824842",
  • "name": "Acmesoft WordWrite"
}

Get Product

Retrieve the properties of an existing product.

Authorizations:
BearerBasic
path Parameters
product-id
required
string
Example: A31B980EAA3B4E33BD50E0C0A0824842

ID of the product

query Parameters
fields
string
Example: fields=name

optional fields to include in response

Responses

Response samples

Content type
application/json
{
  • "type": "product",
  • "ident": "5A55ADEFBA2EB011E528102AF8BBED17"
}

Modify Product

Modify the properties of an existing product

Authorizations:
BearerBasic
path Parameters
product-id
required
string
Example: A31B980EAA3B4E33BD50E0C0A0824842

ID of the product

Request Body schema: application/json

product properties

ident
string

unique ID of the object

type
string

type of this object

Name
string
Publisher
string
Version
string
Platform
string
Category
string
Description
string
Address
string
Array of objects

Expensive The list of program variants in this product (for product editions)

Array of objects

Expensive The list of packages in this product (for product editions)

Array of objects

Expensive The list of products in this family (for product families)

Array of objects

Expensive The list of families that contain this product (for product editions)

Array of objects

Expensive The list of policies that cover this product

...
any

see /api/v2/product/schema/items for full list of properties

Responses

Request samples

Content type
application/json
{
  • "name": "Acmesoft WordWrite 1.0",
  • "publisher": "Acmesoft Software"
}

Delete Product

Remove an existing product from the server's database.

Authorizations:
BearerBasic
path Parameters
product-id
required
string
Example: A31B980EAA3B4E33BD50E0C0A0824842

ID of the product

Responses

Policy Endpoints

Policies are used to configure how the server should record software usage and enforce license limitations. A policy can have one of three actions: Manage, Observe, or Deny. A policy also has a Scope that defines where (or to whom) the policy applies. Each policy references a list of software products that are covered by that policy, and there can be multiple policies that reference the same product.

List Policies

Retrieve a list of all policies that match an optional filter provided in the query parameter.

Authorizations:
BearerBasic
query Parameters
fields
string
Example: fields=name

optional fields to include in response

query
string

optional filter for list results

Responses

Response samples

Content type
application/json
[
  • {
    },
  • {
    }
]

Create Policy

Create a new policy

Authorizations:
BearerBasic
Request Body schema: application/json

policy to create

ident
string

unique ID of the object

type
string

type of this object

Name
string
Section
string
Scope
string
Action
integer <int32>
Metric
integer <int32>
Maximum
integer <int32>
Timeout
integer <int32>
Array of objects
Array of objects (PolicyProduct)

Expensive The list of products covered by this policy

Array of objects (PolicyComputer)

Expensive The list of computers that are licensed (or have used) this policy

Array of objects (PolicyUser)

Expensive The list of users who are licensed (or have used) this policy

...
any

see /api/v2/policy/schema/items for full list of properties

Responses

Request samples

Content type
application/json
{
  • "ident": "0400083B5F6A884600000000",
  • "name": "Acmesoft WordWrite Policy"
}

Get Policy

Retrieve the properties of an existing policy.

Authorizations:
BearerBasic
path Parameters
policy-id
required
string
Example: 0400083B5F6A884600000000

ID of the policy

query Parameters
fields
string
Example: fields=name

optional fields to include in response

Responses

Response samples

Content type
application/json
{
  • "type": "policy",
  • "ident": "0400083B5F6A884600000000"
}

Modify Policy

Modify the properties of an existing policy

Authorizations:
BearerBasic
path Parameters
policy-id
required
string
Example: 0400083B5F6A884600000000

ID of the policy

Request Body schema: application/json

policy properties

ident
string

unique ID of the object

type
string

type of this object

Name
string
Section
string
Scope
string
Action
integer <int32>
Metric
integer <int32>
Maximum
integer <int32>
Timeout
integer <int32>
Array of objects
Array of objects (PolicyProduct)

Expensive The list of products covered by this policy

Array of objects (PolicyComputer)

Expensive The list of computers that are licensed (or have used) this policy

Array of objects (PolicyUser)

Expensive The list of users who are licensed (or have used) this policy

...
any

see /api/v2/policy/schema/items for full list of properties

Responses

Request samples

Content type
application/json
{
  • "maximum": 20
}

Delete Policy

Remove an existing policy from the server's database.

Authorizations:
BearerBasic
path Parameters
policy-id
required
string
Example: 0400083B5F6A884600000000

ID of the policy

Responses

List Policy Products

Retrieve a list of all products that are covered by a policy.

Authorizations:
BearerBasic
path Parameters
policy-id
required
string
Example: 0400083B5F6A884600000000

ID of the policy

Responses

Response samples

Content type
application/json
[
  • {
    },
  • {
    }
]

Add Policy Products

Assign products to a policy

Authorizations:
BearerBasic
Request Body schema: application/json

product(s) to add

One of
productid
string

ID of the product

primary
boolean

primary product for this policy

Responses

Request samples

Content type
application/json
{
  • "productid": "5A55ADEFBA2EB011E528102AF8BBED17",
  • "primary": true
}

Remove Policy Products

Unassign products from a policy.

Authorizations:
BearerBasic
path Parameters
policy-id
required
string
Example: 0400083B5F6A884600000000

ID of the policy

Request Body schema: application/json

product(s) to remove

Array
string

Responses

Request samples

Content type
application/json
[
  • "5A55ADEFBA2EB011E528102AF8BBED17",
  • "A31B980EAA3B4E33BD50E0C0A0824842"
]

Get a Policy Product

Retrieve status of a product covered to a policy.

Authorizations:
BearerBasic
path Parameters
policy-id
required
string
Example: 0400083B5F6A884600000000

ID of the policy

product-id
required
string
Example: A31B980EAA3B4E33BD50E0C0A0824842

ID of the product

Responses

Response samples

Content type
application/json
{
  • "productid": "5A55ADEFBA2EB011E528102AF8BBED17",
  • "primary": true
}

Modify a Policy Product

Modify the status of a product covered by a policy

Authorizations:
BearerBasic
path Parameters
policy-id
required
string
Example: 0400083B5F6A884600000000

ID of the policy

product-id
required
string
Example: A31B980EAA3B4E33BD50E0C0A0824842

ID of the product

Request Body schema: application/json

product reference

productid
string

ID of the product

primary
boolean

primary product for this policy

Responses

Request samples

Content type
application/json
{
  • "primary": true
}

Remove a Policy Product

Unassign a product from a policy.

Authorizations:
BearerBasic
path Parameters
policy-id
required
string
Example: 0400083B5F6A884600000000

ID of the policy

product-id
required
string
Example: A31B980EAA3B4E33BD50E0C0A0824842

ID of the product

Responses

List Policy Computers

Retrieve a list of all computers that are assigned to a policy.

Authorizations:
BearerBasic
path Parameters
policy-id
required
string
Example: 0400083B5F6A884600000000

ID of the policy

Responses

Response samples

Content type
application/json
[
  • {
    },
  • {
    }
]

Add Policy Computers

Assign computers to a policy

Authorizations:
BearerBasic
Request Body schema: application/json

computer(s) to add

One of
computerid
string

ID of the computer

count
integer <int32>
expiration
string <date-time>

ISO time when the assignment will expire

lastuse
string <date-time>

ISO time of last use

Responses

Request samples

Content type
application/json
{
  • "computerid": "B2359823495",
  • "expiration": "2022-09-25T12:34:56.000Z"
}

Remove Policy Computers

Unassign computers from a policy.

Authorizations:
BearerBasic
path Parameters
policy-id
required
string
Example: 0400083B5F6A884600000000

ID of the policy

Request Body schema: application/json

computers to unassign

Array
string

Responses

Request samples

Content type
application/json
[
  • "B2359823495",
  • "B9038590431"
]

Get a Policy Computer

Retrieve status of a computer assigned to a policy.

Authorizations:
BearerBasic
path Parameters
policy-id
required
string
Example: 0400083B5F6A884600000000

ID of the policy

computer-id
required
string
Example: B2359823495

ID of the computer

query Parameters
fields
string
Example: fields=name

optional fields to include in response

Responses

Response samples

Content type
application/json
{
  • "computerid": "B2359823495",
  • "expiration": "2022-09-25T12:34:56.000Z",
  • "lastuse": "2022-08-26T12:34:56.000Z"
}

Modify a Policy Computer

Modify the status of a computer assigned to a policy

Authorizations:
BearerBasic
path Parameters
policy-id
required
string
Example: 0400083B5F6A884600000000

ID of the policy

computer-id
required
string
Example: B2359823495

ID of the computer

Request Body schema: application/json

computer assignment status

computerid
string

ID of the computer

count
integer <int32>
expiration
string <date-time>

ISO time when the assignment will expire

lastuse
string <date-time>

ISO time of last use

Responses

Request samples

Content type
application/json
{
  • "expiration": "2022-09-25T12:34:56.000Z"
}

Remove a Policy Computer

Unassign a computer from a policy.

Authorizations:
BearerBasic
path Parameters
policy-id
required
string
Example: 0400083B5F6A884600000000

ID of the policy

computer-id
required
string
Example: B2359823495

ID of the computer

Responses

List Policy Users

Retrieve a list of all users that are assigned to a policy.

Authorizations:
BearerBasic
path Parameters
policy-id
required
string
Example: 0400083B5F6A884600000000

ID of the policy

Responses

Response samples

Content type
application/json
[
  • {
    },
  • {
    }
]

Add Policy Users

Assign users to a policy

Authorizations:
BearerBasic
Request Body schema: application/json

user(s) to assign

One of
userid
string

ID of the user

expiration
string <date-time>

ISO time when the assignment will expire

lastuse
string <date-time>

ISO time of last use

Responses

Request samples

Content type
application/json
{
  • "userid": "John Doe"
}

Remove Policy Users

Unassign users from a policy.

Authorizations:
BearerBasic
path Parameters
policy-id
required
string
Example: 0400083B5F6A884600000000

ID of the policy

Request Body schema: application/json

users to unassign

Array
string

Responses

Request samples

Content type
application/json
[
  • "John Doe",
  • "Jane Doe"
]

Get a Policy User

Retrieve status of a user assigned to a policy.

Authorizations:
BearerBasic
path Parameters
policy-id
required
string
Example: 0400083B5F6A884600000000

ID of the policy

user-id
required
string
Example: John Doe

ID of the user

Responses

Response samples

Content type
application/json
{
  • "userid": "John Doe",
  • "expiration": "2022-09-25T12:34:56.000Z",
  • "lastuse": "2022-08-26T12:34:56.000Z"
}

Modify a Policy User

Modify the status of a user assigned to a policy

Authorizations:
BearerBasic
path Parameters
policy-id
required
string
Example: 0400083B5F6A884600000000

ID of the policy

user-id
required
string
Example: John Doe

ID of the user

Request Body schema: application/json

user assignment status

userid
string

ID of the user

expiration
string <date-time>

ISO time when the assignment will expire

lastuse
string <date-time>

ISO time of last use

Responses

Request samples

Content type
application/json
{
  • "expiration": "2022-09-25T12:34:56.000Z"
}

Remove a Policy User

Unassign a user from a policy.

Authorizations:
BearerBasic
path Parameters
policy-id
required
string
Example: 0400083B5F6A884600000000

ID of the policy

user-id
required
string
Example: John Doe

ID of the user

Responses

Purchase Endpoints

Purchases record what software and hardware has be bought, what rights and conditions held, various expiration, renewal, and warranty dates, and many other aspects of the assets that are owned by an organization. Purchases of software entitlements can be reconciled against the management policies on the server and compared with software installations and usage on computers.

List Purchases

Retrieve a list of all purchases that match an optional filter provided in the query parameter.

Authorizations:
BearerBasic
query Parameters
fields
string
Example: fields=name

optional fields to include in response

query
string

optional filter for list results

Responses

Response samples

Content type
application/json
[
  • {
    },
  • {
    }
]

Create Purchase

Create a new purchase

Authorizations:
BearerBasic
Request Body schema: application/json

purchase to create

ident
string

unique ID of the object

type
string

type of this object

Name
string
Array of objects (DocumentList)
...
any

see /api/v2/purchase/schema/items for full list of properties

Responses

Request samples

Content type
application/json
{
  • "ident": "0400083B5F6A884600000000",
  • "name": "Acmesoft WordWrite Purchase"
}

Get Purchase

Retrieve the properties of an existing purchase.

Authorizations:
BearerBasic
path Parameters
purchase-id
required
string
Example: 000106323633363332

ID of the purchase

query Parameters
fields
string
Example: fields=name

optional fields to include in response

Responses

Response samples

Content type
application/json
{
  • "type": "purchase",
  • "ident": "0400083B5F6A884600000000"
}

Modify Purchase

Modify the properties of an existing purchase

Authorizations:
BearerBasic
path Parameters
purchase-id
required
string
Example: 000106323633363332

ID of the purchase

Request Body schema: application/json

purchase properties

ident
string

unique ID of the object

type
string

type of this object

Name
string
Array of objects (DocumentList)
...
any

see /api/v2/purchase/schema/items for full list of properties

Responses

Request samples

Content type
application/json
{
  • "entitlements": 20
}

Delete Purchase

Remove an existing purchase from the server's database.

Authorizations:
BearerBasic
path Parameters
purchase-id
required
string
Example: 000106323633363332

ID of the purchase

Responses

List Document References

Retrieve a list of all documents for a purchase.

Authorizations:
BearerBasic
path Parameters
purchase-id
required
string
Example: 000106323633363332

ID of the purchase

Responses

Response samples

Content type
application/json
[
  • {
    },
  • {}
]

Add Document References

Reference documents for a purchase. Use this endpoint to reference web links for a purchase. To store files on the server, use the /api/v2/purchase/documents/{purchase-id} endpoint, which will automatically add a reference for the document.

Authorizations:
BearerBasic
Request Body schema: application/json

document(s) to reference

One of
name
string
date
string <date-time>
url
string
file
string
store
string

Responses

Request samples

Content type
application/json
{}

Remove Document References

Remove documents for a purchase.

Authorizations:
BearerBasic
path Parameters
purchase-id
required
string
Example: 000106323633363332

ID of the purchase

Request Body schema: application/json

documents to remove

Array
string

Responses

Request samples

Content type
application/json
[
  • "manifest-20220925.txt",
  • "AdvanceTech PowerTower 2000"
]

Get a Document Reference

Retrieve the information about a document for a purchase.

Authorizations:
BearerBasic
path Parameters
purchase-id
required
string
Example: 000106323633363332

ID of the purchase

document-id
required
string
Example: invoice-634259.pdf

ID of the document

Responses

Response samples

Content type
application/json
{
  • "name": "manifest-20220925.txt",
  • "date": "2022-08-25T12:34:56.000Z",
  • "file": "/api/v2/purchase/documents/B2359823495/manifest-20220925.txt",
  • "store": "ks-store:///prch/B2359823495/manifest-20220925.txt"
}

Modify a Document Reference

Modify the information about a document for a purchase

Authorizations:
BearerBasic
path Parameters
purchase-id
required
string
Example: 000106323633363332

ID of the purchase

document-id
required
string
Example: invoice-634259.pdf

ID of the document

Request Body schema: application/json

document information

name
string
date
string <date-time>
url
string
file
string
store
string

Responses

Request samples

Content type
application/json
{
  • "date": "2022-09-25T12:34:56.000Z"
}

Remove a Document Reference

Remove the information about a document for a purchase.

Authorizations:
BearerBasic
path Parameters
purchase-id
required
string
Example: 000106323633363332

ID of the purchase

document-id
required
string
Example: invoice-634259.pdf

ID of the document

Responses

List Stored Documents

Retrieve a list of all documents saved for a purchase.

Authorizations:
BearerBasic
query Parameters
fields
string
Example: fields=name

optional fields to include in response

query
string

optional filter for list results

Responses

Response samples

Content type
application/json
[
  • {
    },
  • {
    }
]

Store a Document

Upload a document to the store for this purchase. A document reference will also be added to the purchase record.

Authorizations:
BearerBasic
Request Body schema: content-type

document to upload

any

file data in specified content type

Responses

Get Stored Document

Retrieve the stored document.

Authorizations:
BearerBasic
path Parameters
purchase-id
required
string
Example: 000106323633363332

ID of the purchase

document-id
required
string
Example: invoice-634259.pdf

ID of the document

Responses

Delete Stored Document

Remove an existing document. Any reference to the document will be removed from the purchase record.

Authorizations:
BearerBasic
path Parameters
purchase-id
required
string
Example: 000106323633363332

ID of the purchase

document-id
required
string
Example: invoice-634259.pdf

ID of the document

Responses

User Endpoints

The names of Users are recorded in usage events, associated with computer hardware, and assigned licenses via policies. The user names typically are those that were used to log into the client OS, although the recorded names might be differnt if there are aliases assigned within KeyServer.

The ID of a User record is the same as the Name. This means a User record cannot be renamed, and after initial creation the Name field is read-only. If necessary, the old record can be deleted and a new record created. However, this will break any associations for the old user record. There are better ways to handle renaming users, for example by assigning aliases. That process is beyond the scope of this document.

List Users

Retrieve a list of all users that match an optional filter provided in the query parameter.

Authorizations:
BearerBasic
query Parameters
fields
string
Example: fields=name

optional fields to include in response

query
string

optional filter for list results

Responses

Response samples

Content type
application/json
[
  • {
    },
  • {
    }
]

Create User

Create a new user

Authorizations:
BearerBasic
Request Body schema: application/json

user to create

ident
string

unique ID of the object

type
string

type of this object

Name
string
...
any

see /api/v2/user/schema/items for full list of properties

Responses

Request samples

Content type
application/json
{
  • "ident": "Jimmy Doe",
  • "name": "Jimmy Doe"
}

Get User

Retrieve the properties of an existing user.

Authorizations:
BearerBasic
path Parameters
user-id
required
string
Example: John Doe

ID of the user

query Parameters
fields
string
Example: fields=name

optional fields to include in response

Responses

Response samples

Content type
application/json
{
  • "type": "user",
  • "ident": "John Doe"
}

Modify User

Modify the properties of an existing user

Authorizations:
BearerBasic
path Parameters
user-id
required
string
Example: John Doe

ID of the user

Request Body schema: application/json

user properties

ident
string

unique ID of the object

type
string

type of this object

Name
string
...
any

see /api/v2/user/schema/items for full list of properties

Responses

Request samples

Content type
application/json
{
  • "email": "johndoe@sample.org"
}

Delete User

Remove an existing user from the server's database.

Authorizations:
BearerBasic
path Parameters
user-id
required
string
Example: John Doe

ID of the user

Responses

Date Range Endpoints

Date Ranges are convenient pre-defined spans of time that can be used to limit the times on which reports are run. Date Ranges can also be applied to Time Sets to define a certain range of date that a time set is valid.

The ID of a Date Range is the same as the Name. This means a Date Range cannot be renamed, and after initial creation the Name field is read-only. If necessary, the old Date Range can be deleted and a new Date Range created with the same settings but a different name.

List Date Ranges

Retrieve a list of all date ranges that match an optional filter provided in the query parameter.

Authorizations:
BearerBasic
query Parameters
fields
string
Example: fields=name

optional fields to include in response

query
string

optional filter for list results

Responses

Response samples

Content type
application/json
[
  • {
    },
  • {
    }
]

Create Date Range

Create a new date range

Authorizations:
BearerBasic
Request Body schema: application/json

date range to create

ident
string

unique ID of the object

type
string

type of this object

Name
string

Name for this date range

StartDate
string <date-time>

Start of the date range

EndDate
string <date-time>

End of the date range

Responses

Request samples

Content type
application/json
{
  • "ident": "Fall 2022",
  • "StartDate": "20220907000000Z",
  • "EndDate": "20221124000000Z"
}

Get Date Range

Retrieve the properties of an existing date range.

Authorizations:
BearerBasic
path Parameters
daterange-id
required
string
Example: Fall 2022

ID of the date range

query Parameters
fields
string
Example: fields=name

optional fields to include in response

Responses

Response samples

Content type
application/json
{
  • "ident": "Fall 2022",
  • "type": "daterange",
  • "Name": "Fall 2022",
  • "StartDate": "20220907000000Z",
  • "EndDate": "20221124000000Z"
}

Modify Date Range

Modify the properties of an existing date range

Authorizations:
BearerBasic
path Parameters
daterange-id
required
string
Example: Fall 2022

ID of the date range

Request Body schema: application/json

date range properties

ident
string

unique ID of the object

type
string

type of this object

Name
string

Name for this date range

StartDate
string <date-time>

Start of the date range

EndDate
string <date-time>

End of the date range

Responses

Request samples

Content type
application/json
{
  • "StartDate": "20220907000000Z",
  • "EndDate": "20221124000000Z"
}

Delete Date Range

Remove an existing date range from the server's database.

Authorizations:
BearerBasic
path Parameters
daterange-id
required
string
Example: Fall 2022

ID of the date range

Responses

Time Set Endpoints

Time Sets serve two main purposes. They can be used for defining the "open hours" of Maps pages, and they can be used to refine the times on which reports are run. For Time Sets that are used as a Map's open hours, the name of the Time Set must match the name of the Map. Any time set, whether it is used with a Map or not, can be applied to a report. The report will then only use data that coincides with the times defined by the Time Set.

The ID of a Time Set is the same as the Name. This means a Time Set cannot be renamed, and after initial creation the Name field is read-only. If necessary, the old Time Set can be deleted and a new Time Set created with the same settings but a different name.

List Time Sets

Retrieve a list of all time sets that match an optional filter provided in the query parameter.

Authorizations:
BearerBasic
query Parameters
fields
string
Example: fields=name

optional fields to include in response

query
string

optional filter for list results

Responses

Response samples

Content type
application/json
[
  • {
    },
  • {
    }
]

Create Time Set

Create a new time set

Authorizations:
BearerBasic
Request Body schema: application/json

time set to create

ident
string

unique ID of the object

type
string

type of this object

Name
string

Name of this time set

Array of objects

Expensive The list of time periods in this time set

Responses

Request samples

Content type
application/json
{
  • "ident": "Second Floor",
  • "Periods": [
    ]
}

Get Time Set

Retrieve the properties of an existing time set.

Authorizations:
BearerBasic
path Parameters
timeset-id
required
string
Example: Second Floor

ID of the time set

query Parameters
fields
string
Example: fields=name

optional fields to include in response

Responses

Response samples

Content type
application/json
{
  • "ident": "Second Floor",
  • "type": "timeset",
  • "Name": "Second Floor",
  • "Periods": [
    ]
}

Modify Time Set

Modify the properties of an existing time set

Authorizations:
BearerBasic
path Parameters
timeset-id
required
string
Example: Second Floor

ID of the time set

Request Body schema: application/json

time set properties

ident
string

unique ID of the object

type
string

type of this object

Name
string

Name of this time set

Array of objects

Expensive The list of time periods in this time set

Responses

Request samples

Content type
application/json
{
  • "Periods": [
    ]
}

Delete Time Set

Remove an existing time set from the server's database.

Authorizations:
BearerBasic
path Parameters
timeset-id
required
string
Example: Second Floor

ID of the time set

Responses

Report Endpoints

Reports are used for summarizing and organizing the data gathered by the server. Reports can be used to store historical snapshots for later viewing and reference, and also provide a convenient mid-level cache for much of what is displayed in the Web UI.

The first step in creating a report is to construct or select a report Template. Templates do not contain any data, but rather describe what data to include in a potential report, where to save the report, and when to run it. Templates can be configured to run at a specific scheduled time, run on demand, or run immediately. Typically you would create a template (POST to /report/templates) only when you want to schedule it to run in the future (possibly recurring), or when you want to make the template available for others to run via the Web UI.

If you need to run a report immediately, you can POST a template to the /report/items endpoint. This will queue the report for execution, and return the URI where the completed report will be located once it has completed. How long the report takes to complete will vary widely, and depends on the report type, date range, dataset size, and other settings in the report template.

Once a report has completed it can be accessed within the /report/items container. Completed reports are mostly unchangable, but you can modify a few of the properties such as the title, folder, and notes.

List Reports

Retrieve a list of all reports that match an optional filter provided in the query parameter.

Authorizations:
BearerBasic
query Parameters
fields
string
Example: fields=name

optional fields to include in response

query
string

optional filter for list results

Responses

Response samples

Content type
application/json
[
  • {
    },
  • {
    }
]

Create / Store Report

Create a new report or store a KSR file. If the request data is a report template (application/json) a new report will be queued for execution. If the request data is a KSR file (application/octet-stream) the file will be stored in the Saved Reports archive. Once a KSR is saved in the archive you can move it to a specific folder using a PATCH request.

Authorizations:
BearerBasic
Request Body schema:
ident
string

unique ID of the object

type
string

type of this object

title
string

Display name for this report

folder
string

Folder where this report is saved

notes
string

Notes for this saved report

moduleid
integer <int32>

ID of the report module used to generate the report

modulename
string

Name of the report module used to generate this report

dashboard
string

To maintain one copy of this report, replacing older copies each time the report is run, provide a unique moniker here.

update
integer <int32>

To update an existing instance of this report that is 'out of date', set this property to a negative value indicating the number of seconds after which the report will be conmsidered out of date. A value for the dashboard property must be provided.

boolean or string
range
string

Time range on which to run this report.

slices
string

Time sets on which to run this report.

object

The single subject of the report.

object

An SQL query filter that selects the subjects of the report.

object

A list of tags that selects the subjects of the report.

object

A list of IDs that selects the subjects of the report.

object

A list of IDs or names that selects the subjects of the report.

object

A scope that selects the subjects of the report.

Responses

Request samples

Content type
{
  • "id": 24600,
  • "name": "Available Products",
  • "dashboard": "org.sample.products-in-locations",
  • "update": -86400,
  • "subset": {
    }
}

Get Report

Retrieve the properties of an existing report.

Authorizations:
BearerBasic
path Parameters
report-id
required
string
Example: api-3d4560b3-69b495f9.ksr

ID of the report

query Parameters
fields
string
Example: fields=name

optional fields to include in response

Responses

Response samples

Content type
application/json
{
  • "type": "report",
  • "ident": "api-3d4560b3-69b495f9.ksr"
}

Check Report

Check for the presence of a previously submitted report. Response status 200 indicates the report has completed and can be accessed at the URI. Response status 202 indicates the report is still pending completion. Response statuses in the 4xx range mean that the report is not available and will not be created.

Authorizations:
BearerBasic
path Parameters
report-id
required
string
Example: api-3d4560b3-69b495f9.ksr

ID of the report

Responses

Modify Report

Modify the properties of an existing report

Authorizations:
BearerBasic
path Parameters
report-id
required
string
Example: api-3d4560b3-69b495f9.ksr

ID of the report

Request Body schema: application/json

report properties

ident
string

unique ID of the object

type
string

type of this object

name
string

Display name for this report

folder
string

Folder where this report is saved

notes
string

Notes for this saved report

Responses

Request samples

Content type
application/json
{
  • "folder": "Monthly Reports",
  • "notes": "Usage summary for the month of September 2022"
}

Delete Report

Remove an existing report from the server's report archive.

Authorizations:
BearerBasic
path Parameters
report-id
required
string
Example: api-3d4560b3-69b495f9.ksr

ID of the report

Responses

List Templates

Retrieve a list of all templates that match an optional filter provided in the query parameter.

Authorizations:
BearerBasic
query Parameters
fields
string
Example: fields=name

optional fields to include in response

query
string

optional filter for list results

Responses

Response samples

Content type
application/json
[
  • {
    },
  • {
    }
]

Create Template

Create a new report template

Authorizations:
BearerBasic
Request Body schema: application/json

report template to create

ident
string

unique ID of the object

type
string

type of this object

title
string

Display name for this report

folder
string

Folder where this report is saved

notes
string

Notes for this saved report

moduleid
integer <int32>

ID of the report module used to generate the report

modulename
string

Name of the report module used to generate this report

dashboard
string

To maintain one copy of this report, replacing older copies each time the report is run, provide a unique moniker here.

update
integer <int32>

To update an existing instance of this report that is 'out of date', set this property to a negative value indicating the number of seconds after which the report will be conmsidered out of date. A value for the dashboard property must be provided.

boolean or string
range
string

Time range on which to run this report.

slices
string

Time sets on which to run this report.

object

The single subject of the report.

object

An SQL query filter that selects the subjects of the report.

object

A list of tags that selects the subjects of the report.

object

A list of IDs that selects the subjects of the report.

object

A list of IDs or names that selects the subjects of the report.

object

A scope that selects the subjects of the report.

Responses

Request samples

Content type
application/json
{
  • "ident": "E74072CD3F3949978622805AC6BA88FE",
  • "name": "Current Compliance"
}

Get Template

Retrieve the properties of an existing report template.

Authorizations:
BearerBasic
path Parameters
template-id
required
string
Example: E74072CD3F3949978622805AC6BA88FE

ID of the report template

query Parameters
fields
string
Example: fields=name

optional fields to include in response

Responses

Response samples

Content type
application/json
{
  • "ident": "E74072CD3F3949978622805AC6BA88FE",
  • "type": "template",
  • "name": "Current Compliance",
  • "moduleid": "24200",
  • "modulename": "Compliance (PROD)",
  • "category": "prch",
  • "uri": "kcfg:///report?id=24200&name=Current%20Compliance&owner=John Doe&time=e&...",
  • "author": "John Doe",
  • "source": 0,
  • "frequency": "n",
  • "delay": 0,
  • "range": "e",
  • "guest": 0,
  • "overwrite": 0
}

Modify Template

Replace the properties of an existing report template

Authorizations:
BearerBasic
path Parameters
template-id
required
string
Example: E74072CD3F3949978622805AC6BA88FE

ID of the report template

Request Body schema: application/json

report template properties

ident
string

unique ID of the object

type
string

type of this object

title
string

Display name for this report

folder
string

Folder where this report is saved

notes
string

Notes for this saved report

moduleid
integer <int32>

ID of the report module used to generate the report

modulename
string

Name of the report module used to generate this report

dashboard
string

To maintain one copy of this report, replacing older copies each time the report is run, provide a unique moniker here.

update
integer <int32>

To update an existing instance of this report that is 'out of date', set this property to a negative value indicating the number of seconds after which the report will be conmsidered out of date. A value for the dashboard property must be provided.

boolean or string
range
string

Time range on which to run this report.

slices
string

Time sets on which to run this report.

object

The single subject of the report.

object

An SQL query filter that selects the subjects of the report.

object

A list of tags that selects the subjects of the report.

object

A list of IDs that selects the subjects of the report.

object

A list of IDs or names that selects the subjects of the report.

object

A scope that selects the subjects of the report.

Responses

Request samples

Content type
application/json
{
  • "ident": "E74072CD3F3949978622805AC6BA88FE",
  • "name": "Latest Compliance"
}

Modify Template

Modify certain properties of an existing report template

Authorizations:
BearerBasic
path Parameters
template-id
required
string
Example: E74072CD3F3949978622805AC6BA88FE

ID of the report template

Request Body schema: application/json

report template properties

folder
string

Responses

Request samples

Content type
application/json
{
  • "folder": "Automated Reports"
}

Delete Template

Remove an existing report template from the data.

Authorizations:
BearerBasic
path Parameters
template-id
required
string
Example: E74072CD3F3949978622805AC6BA88FE

ID of the report template

Responses

Report Content Endpoints

Reports saved in the Web UI can be read within the /report/items/... endpoints. The endpoints within each report instance access the data specific to that report. Each report can contain different information, columns, and result rows. The fields available via these endpoints depend on which report was run and the run-time report parameters.

These endpoints are typically used when a report is generated periodically in order to cache information, and the information is then used on web pages or for internal processes. For example, widgets, extras, and other Web UI components will maintain a set of up-to-date reports that can then be queried for summary information via these endpoints.

List Information

Retrieve information about the content of a saved report.

Authorizations:
BearerBasic
path Parameters
report-id
required
string
Example: api-3d4560b3-69b495f9.ksr

ID of the report

query Parameters
fields
string
Example: fields=name

optional fields to include in response

Responses

Response samples

Content type
application/json
[
  • {
    },
  • {
    },
  • {
    }
]

List Views

Retrieve information about the views contained in a saved report.

Authorizations:
BearerBasic
path Parameters
report-id
required
string
Example: api-3d4560b3-69b495f9.ksr

ID of the report

query Parameters
fields
string
Example: fields=name

optional fields to include in response

Responses

Response samples

Content type
application/json
[
  • {
    },
  • {
    }
]

List Columns

Retrieve information about the columns contained in a saved report.

Authorizations:
BearerBasic
path Parameters
report-id
required
string
Example: api-3d4560b3-69b495f9.ksr

ID of the report

query Parameters
fields
string
Example: fields=name

optional fields to include in response

Responses

Response samples

Content type
application/json
[
  • {
    },
  • {
    }
]

List Rows

Retrieve the row data contained in a saved report.

Authorizations:
BearerBasic
path Parameters
report-id
required
string
Example: api-3d4560b3-69b495f9.ksr

ID of the report

query Parameters
fields
string
Example: fields=name

optional fields to include in response

view
number
Example: view=1

optional ID of the report view (defaults to view=0)

Responses

Response samples

Content type
application/json
[
  • {
    },
  • {
    },
  • {
    }
]

Map Endpoints

Availability Maps are organized into Map Sets, which assign computers to the maps based on Divisions or Labeled Tags. A map set defines whether its maps use Divisons or Tags, and which tag is used for tag-based maps. A map set has general properties like a name (title) and description, and contains information relevant to all maps on the map, such as whether the map set is publicaly viewable to all who browse to the server.

Each Map in a map set indicates which Division or Tag label is included on the map. All computer in that Division or with that Tag label are candidates for display on the map's page. Each map has a name (title), description, location, and various options that control how the map is displayed. Maps can have associated graphical layouts, information pages, and time schedules.

List Map Sets

Retrieve a list of all map sets that match an optional filter provided in the query parameter.

Authorizations:
BearerBasic
query Parameters
fields
string
Example: fields=name

optional fields to include in response

query
string

optional filter for list results

Responses

Response samples

Content type
application/json
[
  • {
    },
  • {
    }
]

Create Map Set

Create a new map set.

Authorizations:
BearerBasic
Request Body schema: application/json
ident
string

unique ID of the object

type
string

type of this object

name
string

Name for this map set

title
string

Display name for this map set

description
string

Descriptions for this map set

ptype
string
Enum: "divn" "divp" "tagd"

Scoping type for this map set

pname
string

Scoping parameter for this map set

publish
boolean

Map set is visible to public viewers

nogeomap
boolean

Map set does not display a location map

inuse
boolean

Map set shows in use status bars instead of availability status bars

Responses

Request samples

Content type
application/json
{
  • "ident": "second-floor",
  • "name": "Second Floor",
  • "publish": false,
  • "ptype": "divn",
  • "nogeomap": false,
  • "inuse": false
}

Get Map Set

Retrieve the properties of an existing map set.

Authorizations:
BearerBasic
path Parameters
mapset-id
required
string
Example: second-floor

ID of the map set

query Parameters
fields
string
Example: fields=name

optional fields to include in response

Responses

Response samples

Content type
application/json
{
  • "ident": "second-floor",
  • "type": "mapset",
  • "name": "Second Floor",
  • "publish": false,
  • "ptype": "divn",
  • "nogeomap": false,
  • "inuse": false,
  • "slug": "ZYTNz_s0"
}

Modify Map Set

Modify the properties of an existing map set

Authorizations:
BearerBasic
path Parameters
mapset-id
required
string
Example: second-floor

ID of the map set

Request Body schema: application/json

report map set properties

ident
string

unique ID of the object

type
string

type of this object

name
string

Name for this map set

title
string

Display name for this map set

description
string

Descriptions for this map set

ptype
string
Enum: "divn" "divp" "tagd"

Scoping type for this map set

pname
string

Scoping parameter for this map set

publish
boolean

Map set is visible to public viewers

nogeomap
boolean

Map set does not display a location map

inuse
boolean

Map set shows in use status bars instead of availability status bars

Responses

Request samples

Content type
application/json
{
  • "publish": true
}

Delete Map Set

Remove an existing map set from the data.

Authorizations:
BearerBasic
path Parameters
mapset-id
required
string
Example: second-floor

ID of the map set

Responses

List Maps

Retrieve a list of all maps within a map set that match an optional filter provided in the query parameter.

Authorizations:
BearerBasic
path Parameters
mapset-id
required
string
Example: second-floor

ID of the map set

query Parameters
fields
string
Example: fields=name

optional fields to include in response

query
string

optional filter for list results

Responses

Response samples

Content type
application/json
[
  • {
    },
  • {
    }
]

Create Map

Create a new map.

Authorizations:
BearerBasic
path Parameters
mapset-id
required
string
Example: second-floor

ID of the map set

Request Body schema: application/json
ident
string

unique ID of the object

type
string

type of this object

name
string

Name for this map

title
string

Display name for this map

description
string

Descriptions for this map

ptype
string
Enum: "divn" "divp" "tagd"

Scoping type for this map

pname
string

Scoping parameter for this map

pdata
string

Scoping parameter for this map

publish
boolean

Map is visible to public viewers

noheatmap
boolean

Map does not display a heat map

offavail
boolean

Map shows Off status as Available

Responses

Request samples

Content type
application/json
{
  • "name": "Floor2.Room-206",
  • "title": "Room 206",
  • "ptype": "divn",
  • "pname": "Floor2.Room-206",
  • "pdata": "0x0000FFFC",
  • "publish": true,
  • "noheatmap": false,
  • "offavail": false
}

Get Map

Retrieve properties of an existing map.

Authorizations:
BearerBasic
path Parameters
mapset-id
required
string
Example: second-floor

ID of the map set

map-id
required
string
Example: 74a9ab474034b3bccfee28fc04d46e0d

ID of the map

query Parameters
fields
string
Example: fields=name

optional fields to include in response

Responses

Response samples

Content type
application/json
{
  • "type": "map",
  • "ident": "8f32df98acbc9a6e83d1b5ed3ca87911",
  • "version": 2,
  • "name": "Floor2.Room-206",
  • "title": "Room 206",
  • "ptype": "divn",
  • "pname": "Floor2.Room-206",
  • "pdata": "0x0000FFFC",
  • "publish": true,
  • "noheatmap": false,
  • "offavail": false,
  • "slug": "N73yuh4c"
}

Modify Map

Change properties of an existing map.

Authorizations:
BearerBasic
path Parameters
mapset-id
required
string
Example: second-floor

ID of the map set

map-id
required
string
Example: 74a9ab474034b3bccfee28fc04d46e0d

ID of the map

Request Body schema: application/json
ident
string

unique ID of the object

type
string

type of this object

name
string

Name for this map

title
string

Display name for this map

description
string

Descriptions for this map

ptype
string
Enum: "divn" "divp" "tagd"

Scoping type for this map

pname
string

Scoping parameter for this map

pdata
string

Scoping parameter for this map

publish
boolean

Map is visible to public viewers

noheatmap
boolean

Map does not display a heat map

offavail
boolean

Map shows Off status as Available

Responses

Request samples

Content type
application/json
{
  • "title": "Room 206",
  • "publish": true,
  • "noheatmap": false
}

Delete Map

Remove an existing map from the data.

Authorizations:
BearerBasic
path Parameters
mapset-id
required
string
Example: second-floor

ID of the map set

map-id
required
string
Example: 74a9ab474034b3bccfee28fc04d46e0d

ID of the map

Responses

Bulk Query Endpoints

When querying for bulk data or constructing results based on data joined from multiple object tables, it might be more efficient to use Bulk SQL Queries instead of using the REST API resource/object endpoints. The data can be queried with standard SQL query select statements, with results returned in a simple rowset format. The Bulk Query Endpoints only support reading data. Queries that modify or delete data are not supported and will return an error result.

When an SQL Error occurs, the response body will contain the error codes and description, and the HTTP status will be 200 OK.

Documentation on the table schema can be found in the KeyServer Platform documentation. That documentation covers all of the available tables and their column definitions, as well as relationships between tables.

Post an SQL Query

Run an SQL query, return results.

Authorizations:
BearerBasic
query Parameters
level
integer

optional level of information in results (0-3)

Request Body schema: text/plain

SQL query to run

string (SQLQuery)

Responses

Request samples

Content type
text/plain
SELECT termID,termValue
    FROM KSTermLifeStage
    WHERE (termID < 3)

Response samples

Content type
application/json
Example
{
  • "rows": [
    ]
}

List SQL Tables

Retrieve a list of all tables that can be queried via SQL.

Authorizations:
BearerBasic
query Parameters
fields
string
Example: fields=name

optional fields to include in response

Responses

Response samples

Content type
application/json
[
  • {
    },
  • {
    },
  • {
    }
]

Get SQL Table Schema

Get the full column schema for a given table.

Authorizations:
BearerBasic
path Parameters
table-name
required
string
Example: KSComputers

Name of the table

query Parameters
fields
string
Example: fields=name

optional fields to include in response

Responses

Response samples

Content type
application/json
[
  • {
    },
  • {
    }
]