Modify a device

Update 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 both 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 belong to
server_group_id
optional
string
Server Group ID of the group to which the device should belong
Body Parameters
ip_addrs
optional
string
Server IP address.
exception
optional
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
204: No Content
Update successful. No data is returned.

Example Device update

{
"server_group_id": 0,
"exception": true,
"tags": [
"string"
],
"custom_name": "string"
"ip_addrs": [
"111.111.111.111"
],
}

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": 0,
"exception": true,
"tags": [
"string"
],
"custom_name": "string"
}'
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