Request Guidelines

HTTP Methods

Kaseya REST API requests use the following HTTP methods:

  • GET - returns data
  • PUT - changes data or performs an action
  • POST - adds a new record
  • DELETE - deletes a record

Action URIs

A REST API can perform an action. Examples of Kaseya REST API actions are:

PUT /assetmgmt/audit/baseline/{agentId}/runnow

PUT /assetmgmt/audit/baseline/{agentId}/schedule

Although these URIs use the PUT method, no data is changed when the action is performed.

JSON and XML

In most cases, content contained within the body of Kaseya REST API requests and responses must be formatted as JSON or XML expressions. By default, all relevant Kaseya REST API responses are serialized to JSON. To force an XML response, include the Accept response header with a value of application/xml. Similarly, requests that include body content should specify the format of the content by using the Content-Type request header set to either application/json or application/xml.

Arguments

Each request may require additional arguments to process the request successfully. The additional arguments are provided in three ways:

  • URI Suffixes - A unique identifier is appended as a suffix to the URI requested. For example, an agent GUID--returned by a previous request--is appended to a GET /AssetMgmt/Assets/{assetId} request to return additional details about that asset.
  • Headers - Headers can contain arguments returned by a previous request. The most common use is the Authorization: Bearer {SessionToken} header. Headers are not typically used to pass business data. See the first four lines in the JSON example below.
  • Message Body -Some resources may require data in the message body of the request, usually after skipping one or two lines after the last header argument. See the last four lines in the JSON example below.

NOTE   Each resource documentation topic describes the arguments required to process a request successfully.

The following is a JSON example:

PUT http://10.10.32.90/API/v1.0/system/orgs HTTP/1.1
Host: 10.10.32.90
Authorization: Bearer 80684803803769050726142880
Content-Type: application/json
{
   "OrgId": "7.213597641814316e+25"
   "OrgRef": "Starfire"
}