Create a new group

Creates a new server group

post
/servergroups

https://console.automox.com/api/servergroups
Request
Response
Request
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 created group
Body Parameters
name
required
string
Name of the group
refresh_interval
required
integer
Frequency of device refreshes (scans) in minutes. Minimum: 360 Maximum: 1440
parent_server_group_id
required
integer
ID of the parent group Use the organization's Default Group ID to make this a top-level group. See Note: Default Group ID
ui_color
optional
string
The highlight color for the group. Primarily used on the System Management view. Format: #059F1D See Note UI Color
notes
optional
string
Use to define notes that are displayed while editing the policy
enable_os_auto_update
optional
boolean
Enforce automatic update settings Options: null: Keep Device's Setting true: Enable OS automatic updates false: Disable OS automatic updates
enable_wsus
optional
boolean
Enforce WSUS settings for Windows devices Options: null: Keep Device's Setting true: force WSUS false: force Windows Update
wsus_server
optional
string
WSUS server address. Use with enable_wsus. Format: "http://myserver.com:8530"
policies
optional
array
List of Policies to link to this group.
Response
200: OK
{
"type": "object",
"properties": {
"name": {
"type": "string"
},
"override": {
"type": "boolean"
},
"parent_server_group_id": {
"type": "integer",
"format": "int64"
},
"refresh_interval": {
"type": "integer",
"format": "int64"
}
}
}

Note: Default Group ID

You can determine an organization's Default Group ID by listing the groups and looking for the group with a blank name: "name": ""

Note: UI Color

The API will accept any value for UI Color. However, if you use a color that is not in the pre-defined list, it will default to Pine Green when saving via the Group Editor UI. The pre-defined colors are the following:

  • Pine Green: #059F1D

  • Salmon: #CC6666

  • Lemonade: #E9FF03

  • Bubblegum: #FFa4c0

  • Colorado Snow: #FFFFFF

  • Battleship Hull: #61666F

  • Utah Clay: #D78500

  • Electric Violet: #BD0FE1

  • Forgot Sunscreen: #F65C23

Example JSON Group Object

{
"name": "API Creation",
"refresh_interval": 1440,
"parent_server_group_id": 23500,
"ui_color": "#FFFFFF",
"notes": "2 Policies, White, Force WSUS",
"enable_os_auto_update": false,
"enable_wsus": true,
"wsus_server": "http://myserver.com:8530",
"policies": [
18627,
22645
]
}

Example Requests

cURL
Python http.client
Python requests
C#
PowerShell
cURL
curl -X POST \
'https://console.automox.com/api/servergroups?o=0000' \
-H 'Authorization: Bearer your_automox_api_key' \
-H 'Content-Type: application/json' \
-d '{
"name": "API Creation",
"refresh_interval": 1440,
"parent_server_group_id": 23500,
"ui_color": "#FFFFFF",
"notes": "2 Policies, White, Force WSUS",
"enable_os_auto_update": false,
"enable_wsus": true,
"wsus_server": "http://myserver.com:8530",
"policies": [
18627,
22645
]
}'
Python http.client
import http.client
conn = http.client.HTTPConnection("console,automox,com")
payload = "{\r\n \"name\": \"API Creation\",\r\n \"refresh_interval\": 1440,\r\n \"parent_server_group_id\": 23500,\r\n \"ui_color\": \"#FFFFFF\",\r\n \"notes\": \"2 Policies, White, Force WSUS\",\r\n \"enable_os_auto_update\": false,\r\n\t\"enable_wsus\": true,\r\n\t\"wsus_server\": \"http://myserver.com:8530\",\r\n \"policies\": [\r\n 18627,\r\n 22645\r\n ]\r\n}"
headers = {
'Content-Type': "application/json",
'Authorization': "Bearer your_automox_api_key"
}
conn.request("POST", "api,servergroups", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
Python requests
import requests
url = "https://console.automox.com/api/servergroups"
querystring = {"o":"0000"}
payload = "{\r\n \"name\": \"API Creation\",\r\n \"refresh_interval\": 1440,\r\n \"parent_server_group_id\": 23500,\r\n \"ui_color\": \"#FFFFFF\",\r\n \"notes\": \"2 Policies, White, Force WSUS\",\r\n \"enable_os_auto_update\": false,\r\n\t\"enable_wsus\": true,\r\n\t\"wsus_server\": \"http://myserver.com:8530\",\r\n \"policies\": [\r\n 18627,\r\n 22645\r\n ]\r\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/servergroups?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", "{\r\n \"name\": \"API Creation\",\r\n \"refresh_interval\": 1440,\r\n \"parent_server_group_id\": 23500,\r\n \"ui_color\": \"#FFFFFF\",\r\n \"notes\": \"2 Policies, White, Force WSUS\",\r\n \"enable_os_auto_update\": false,\r\n\t\"enable_wsus\": true,\r\n\t\"wsus_server\": \"http://myserver.com:8530\",\r\n \"policies\": [\r\n 18627,\r\n 22645\r\n ]\r\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
PowerShell
$apiKey = 'your_automox_api_key'
$headers = @{
"Authorization" = "Bearer $apiKey"
"Content-Type" = "application/json"
}
$body = @"
{
"name": "API Creation",
"refresh_interval": 1440,
"parent_server_group_id": 23500,
"ui_color": "#FFFFFF",
"notes": "2 Policies, White, Force WSUS",
"enable_os_auto_update": false,
"enable_wsus": true,
"wsus_server": "http://myserver.com:8530",
"policies": [
18627,
22645
]
}
"@
$url = "https://console.automox.com/api/servergroups?o=0000"
Invoke-WebRequest -Method Post -Uri $url -Headers $headers -Body $body

post

https://console.automox.com/api/servergroups
Request
Response
Request
Path Parameters
optional
string
Response
200: OK