Issue a command to a device

Force a device to Scan, Patch, or Reboot for immediate execution

post
/servers/{id}/queues

https://console.automox.com/api/servers/{id}/queues
Command Types Include: GetOS - Triggers a device scan InstallUpdate - Installs a specific patch InstallAllUpdates - Installs all available patches. Warning: This ignores any Policy Filters policy_{policy_id}_test - Evaluates compliance against a Worklet policy_{policy_id}_remediate - Forces remediation of a Worklet or Required Software Policy Reboot - Forces a reboot
Request
Response
Request
Path Parameters
id
required
integer
Server ID for the specified device
Headers
Content-Type: application/json
required
string
Specify json as the content type for body parameters
Authorization: Bearer
required
string
Your Automox API Key for authentication Format: Authorization: Bearer your_automox_api_key
Query Parameters
o
required
integer
Organization ID for the specified device
Body Parameters
command_type_name
required
string
Name of the command to send to the device. See above for allowed commands.
args
optional
string
Only needed for "InstallUpdate". Includes the name of the patches to install.
Response
200: OK
{
"type": "object",
"required": [
"args",
"command_type_name",
"exec_time"
],
"example": {
"command_type_name": "InstallUpdate",
"args": "KB12345 KB67890",
"exec_time": "2017-06-29T16:39:50.951Z"
},
"properties": {
"id": {
"type": "integer",
"format": "int64"
},
"server_id": {
"type": "integer",
"format": "int64"
},
"policy_id": {
"type": "integer",
"format": "int64"
},
"command_id": {
"type": "integer",
"format": "int64"
},
"command_type_name": {
"type": "string",
"enum": [
"InstallUpdate",
"Reboot"
],
"description": "Type of command being issued"
},
"args": {
"type": "string",
"example": "\"KB12345 KB67890\"",
"description": "List of patches to apply, or NULL if issuing a Reboot"
},
"response": {
"type": "string"
},
"response_time": {
"type": "string",
"format": "date-time"
},
"create_time": {
"type": "string",
"format": "date-time"
},
"exec_time": {
"type": "string",
"format": "date-time",
"example": "2017-06-29T16:39:50.951Z",
"description": "Time to execute the command, or NULL if issuing a Reboot"
}
}
}

Example Requests

cURL
Python http.client
Python requests
C#
PowerShell
cURL
curl -X POST \
'https://console.automox.com/api/servers/123456/queues?o=0000' \
-H 'Authorization: Bearer your_automox_api_key' \
-H 'Content-Type: application/json' \
-d '{
"command_type_name": "Reboot"
}'
Python http.client
import http.client
conn = http.client.HTTPConnection("console,automox,com")
payload = "{\n \"command_type_name\": \"Reboot\",\n \"exec_time\": \"2019-09-19T16:18:51+0000\"\n}"
headers = {
'Content-Type': "application/json",
'Authorization': "Bearer your_automox_api_key"
}
conn.request("POST", "api,servers,123456,queues", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
Python requests
import requests
url = "https://console.automox.com/api/servers/123456/queues"
querystring = {"o":"0000"}
payload = "{\n \"command_type_name\": \"Reboot\",\n \"exec_time\": \"2019-09-19T16:18:51+0000\"\n}"
headers = {
'Content-Type': "application/json",
'Authorization': "Bearer your_automox_api_key"
}
response = requests.request("POST", url, data=payload, headers=headers, params=querystring)
print(response.text)
C#
var client = new RestClient("https://console.automox.com/api/servers/123456/queues?o=0000");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer your_automox_api_key");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("undefined", "{\n \"command_type_name\": \"Reboot\", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
PowerShell
$apiKey = 'your_automox_api_key'
$headers = @{
"Authorization" = "Bearer $apiKey"
"Content-Type" = "application/json"
}
$body = @{
command_type_name = "Reboot"
}
$url = "https://console.automox.com/api/servers/123456/queues?o=0000"
Invoke-WebRequest -Method Post -Uri $url -Headers $headers -Body ($body | ConvertTo-Json)

Example Requests with ARGS

cURL
Python http.client
Python requests
C#
PowerShell
cURL
curl -X POST \
'https://console.automox.com/api/servers/123456/queues?o=0000' \
-H 'Authorization: Bearer your_automox_api_key' \
-H 'Content-Type: application/json' \
-d '{
"command_type_name": "InstallUpdate",
"args": "2e7e5661-f7c8-4a21-a65a-52d0fdf8841a"
}'
Python http.client
import http.client
conn = http.client.HTTPConnection("console,automox,com")
payload = "{\n \"command_type_name\": \"InstallUpdate\",\n \"args\": \"2e7e5661-f7c8-4a21-a65a-52d0fdf8841a\"\n}"
headers = {
'Content-Type': "application/json",
'Authorization': "Bearer your_automox_api_key"
}
conn.request("POST", "api,servers,123456,queues", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
Python requests
import requests
url = "https://console.automox.com/api/servers/123456/queues"
querystring = {"o":"0000"}
payload = "{\n \"command_type_name\": \"InstallUpdate\",\n \"args\": \"2e7e5661-f7c8-4a21-a65a-52d0fdf8841a\"\n}"
headers = {
'Content-Type': "application/json",
'Authorization': "Bearer your_automox_api_key"
}
response = requests.request("POST", url, data=payload, headers=headers, params=querystring)
print(response.text)
C#
var client = new RestClient("https://console.automox.com/api/servers/123456/queues?o=0000");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer your_automox_api_key");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("undefined", "{\n \"command_type_name\": \"InstallUpdate\",\n \"args\": \"2e7e5661-f7c8-4a21-a65a-52d0fdf8841a\"\n}", ParameterType.RequestBody);
PowerShell
$apiKey = 'your_automox_api_key'
$headers = @{
"Authorization" = "Bearer $apiKey"
"Content-Type" = "application/json"
}
$body = @{
command_type_name = "InstallUpdate"
args = "2e7e5661-f7c8-4a21-a65a-52d0fdf8841a"
}
$url = "https://console.automox.com/api/servers/123456/queues?o=0000"
Invoke-WebRequest -Method Post -Uri $url -Headers $headers -Body ($body | ConvertTo-Json)