Modify a device

Updates a device (server object).

put
/servers/{id}

https://console.automox.com/api/servers/{id}
Send a JSON object in the request body to update device details
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
string
Organization ID the device belongs to
Body Parameters
server_group_id
required
integer
Server Group ID of the group to which the device should belong
exception
required
boolean
Set the exception property for the device
tags
optional
array
List of tags
custom_name
optional
string
Custom name that will display in the console instead of the hostname
Response
200: OK
{
"type": "object",
"properties": {
"id": {
"type": "integer",
"format": "int64"
},
"create_time": {
"type": "string",
"format": "date-time"
},
"deleted": {
"type": "boolean"
},
"detail": {
"type": "object",
"properties": {
"CPU": {
"type": "string"
},
"DISKS": {
"type": "array",
"items": {
"type": "object",
"properties": {
"SIZE": {
"type": "string"
},
"TYPE": {
"type": "string"
}
}
}
},
"MODEL": {
"type": "string"
},
"NICS": {
"type": "array",
"items": {
"type": "object",
"properties": {
"CONNECTED": {
"type": "boolean"
},
"DEVICE": {
"type": "string"
},
"IPS": {
"type": "array",
"items": {
"type": "string"
}
},
"MAC": {
"type": "string"
},
"TYPE": {
"type": "string"
},
"VENDOR": {
"type": "string"
}
}
}
},
"RAM": {
"type": "string"
},
"SERIAL": {
"type": "string"
},
"SERVICETAG": {
"type": "string"
},
"VENDOR": {
"type": "string"
},
"VERSION": {
"type": "string"
}
}
},
"instance_id": {
"type": "string"
},
"ip_addrs": {
"type": "array",
"items": {
"type": "string"
}
},
"last_checkin_time": {
"type": "string",
"format": "date-time"
},
"last_refresh_time": {
"type": "string",
"format": "date-time"
},
"last_update_time": {
"type": "string",
"format": "date-time"
},
"name": {
"type": "string"
},
"needs_reboot": {
"type": "boolean"
},
"organization_id": {
"type": "integer",
"format": "int64"
},
"os_family": {
"type": "string"
},
"os_name": {
"type": "string"
},
"os_version_id": {
"type": "integer",
"format": "int64"
},
"patches": {
"type": "integer",
"format": "int64"
},
"refresh_interval": {
"type": "integer",
"format": "int64"
},
"server_group_id": {
"type": "integer",
"format": "int64"
},
"tags": {
"type": "array",
"items": {
"type": "string"
}
},
"timezone": {
"type": "string"
},
"uptime": {
"type": "integer",
"format": "int64"
},
"uuid": {
"type": "string"
}
}
}

Example JSON Server Object

{
"server_group_id": 23762,
"tags": [
"Tag1",
"Tag2",
"Tag3"
],
"custom_name": null,
"exception": false
}

Example Requests

cURL
Python http.client
Python requests
C#
PowerShell
cURL
curl -X PUT \
'https://console.automox.com/api/servers/123456?o=0000' \
-H 'Authorization: Bearer your_automox_api_key' \
-H 'Content-Type: application/json' \
-d '{
"server_group_id": 12345,
"tags": [
"Tag1",
"Tag2",
"Tag3"
],
"custom_name": null,
"exception": false
}'
Python http.client
import http.client
conn = http.client.HTTPConnection("console,automox,com")
payload = "{\"server_group_id\": 12345,\"tags\": [\"Tag1\",\"Tag2\",\"Tag3\"],\"custom_name\": null,\"exception\": false}"
headers = {
'Content-Type': "application/json",
'Authorization': "Bearer your_automox_api_key"
}
conn.request("PUT", "api,servers,123456", 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"
querystring = {"o":"0000"}
payload = "{\"server_group_id\": 12345,\"tags\": [\"Tag1\",\"Tag2\",\"Tag3\"],\"custom_name\": null,\"exception\": false}"
headers = {
'Content-Type': "application/json",
'Authorization': "Bearer your_automox_api_key"
}
response = requests.request("PUT", url, data=payload, headers=headers, params=querystring)
print(response.text)
C#
var client = new RestClient("https://console.automox.com/api/servers/123456?o=0000");
var request = new RestRequest(Method.PUT);
request.AddHeader("Authorization", "Bearer your_automox_api_key");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("undefined", "{\"server_group_id\": 12345,\"tags\": [\"Tag1\",\"Tag2\",\"Tag3\"],\"custom_name\": null,\"exception\": false}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
PowerShell
$apiKey = 'your_automox_api_key'
$headers = @{
"Authorization" = "Bearer $apiKey"
"Content-Type" = "application/json"
}
$body = @"
{
"server_group_id": 12345,
"tags": [
"Tag1",
"Tag2",
"Tag3"
],
"custom_name": null,
"exception": false
}
"@
$url = "https://console.automox.com/api/servers/123456?o=0000"
Invoke-WebRequest -Method Put -Uri $url -Headers $headers -Body $body