Update a Device
curl --request PUT \
--url https://manage.nervescloud.com/api/orgs/{org_name}/products/{product_name}/devices/{identifier} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"device": {
"deployment_group_id": 1,
"description": "Example Device",
"tags": "prod, customerJNK",
"updates_enabled": false
}
}
'import requests
url = "https://manage.nervescloud.com/api/orgs/{org_name}/products/{product_name}/devices/{identifier}"
payload = { "device": {
"deployment_group_id": 1,
"description": "Example Device",
"tags": "prod, customerJNK",
"updates_enabled": False
} }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
device: {
deployment_group_id: 1,
description: 'Example Device',
tags: 'prod, customerJNK',
updates_enabled: false
}
})
};
fetch('https://manage.nervescloud.com/api/orgs/{org_name}/products/{product_name}/devices/{identifier}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://manage.nervescloud.com/api/orgs/{org_name}/products/{product_name}/devices/{identifier}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'device' => [
'deployment_group_id' => 1,
'description' => 'Example Device',
'tags' => 'prod, customerJNK',
'updates_enabled' => false
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://manage.nervescloud.com/api/orgs/{org_name}/products/{product_name}/devices/{identifier}"
payload := strings.NewReader("{\n \"device\": {\n \"deployment_group_id\": 1,\n \"description\": \"Example Device\",\n \"tags\": \"prod, customerJNK\",\n \"updates_enabled\": false\n }\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://manage.nervescloud.com/api/orgs/{org_name}/products/{product_name}/devices/{identifier}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"device\": {\n \"deployment_group_id\": 1,\n \"description\": \"Example Device\",\n \"tags\": \"prod, customerJNK\",\n \"updates_enabled\": false\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://manage.nervescloud.com/api/orgs/{org_name}/products/{product_name}/devices/{identifier}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"device\": {\n \"deployment_group_id\": 1,\n \"description\": \"Example Device\",\n \"tags\": \"prod, customerJNK\",\n \"updates_enabled\": false\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"connection_status": "connected",
"deployment_group": {
"firmware_uuid": "6fd2bbc8-52b8-4826-5c2a-189968d0de23",
"firmware_version": "1.2.3",
"is_active": true,
"name": "Prod Deployment"
},
"description": "A great device",
"firmware_metadata": {
"architecture": "arm",
"author": "",
"description": "Prod Firmware",
"fwup_version": "1.10.1",
"id": "3f2264c3-cc52-2ba9-b77d-e441f8bb91b6",
"misc": "extra comments",
"platform": "rpi5",
"product": "AmazingProduct",
"uuid": "6fd2bbc8-52b8-4826-5c2a-189968d0de23",
"vcs_identifier": "",
"version": "1.2.3"
},
"identifier": "abc123",
"last_communication": "2050-04-20T00:33:09Z",
"online": true,
"org_name": "BigCompany",
"product_name": "AmazingProduct",
"tags": "prod, customerABC",
"updates_blocked_until": "2050-04-20T00:33:09Z",
"updates_enabled": true,
"version": "1.2.3"
}
}{
"errors": {
"detail": "Resource Not Found or Authorization Insufficient"
}
}{
"errors": {
"detail": "Resource Not Found or Authorization Insufficient"
}
}{
"errors": {
"detail": "Resource Not Found or Authorization Insufficient"
}
}{
"errors": {
"identifier": [
"can't be blank"
]
}
}Devices
Update a Device
PUT
/
api
/
orgs
/
{org_name}
/
products
/
{product_name}
/
devices
/
{identifier}
Update a Device
curl --request PUT \
--url https://manage.nervescloud.com/api/orgs/{org_name}/products/{product_name}/devices/{identifier} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"device": {
"deployment_group_id": 1,
"description": "Example Device",
"tags": "prod, customerJNK",
"updates_enabled": false
}
}
'import requests
url = "https://manage.nervescloud.com/api/orgs/{org_name}/products/{product_name}/devices/{identifier}"
payload = { "device": {
"deployment_group_id": 1,
"description": "Example Device",
"tags": "prod, customerJNK",
"updates_enabled": False
} }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
device: {
deployment_group_id: 1,
description: 'Example Device',
tags: 'prod, customerJNK',
updates_enabled: false
}
})
};
fetch('https://manage.nervescloud.com/api/orgs/{org_name}/products/{product_name}/devices/{identifier}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://manage.nervescloud.com/api/orgs/{org_name}/products/{product_name}/devices/{identifier}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'device' => [
'deployment_group_id' => 1,
'description' => 'Example Device',
'tags' => 'prod, customerJNK',
'updates_enabled' => false
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://manage.nervescloud.com/api/orgs/{org_name}/products/{product_name}/devices/{identifier}"
payload := strings.NewReader("{\n \"device\": {\n \"deployment_group_id\": 1,\n \"description\": \"Example Device\",\n \"tags\": \"prod, customerJNK\",\n \"updates_enabled\": false\n }\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://manage.nervescloud.com/api/orgs/{org_name}/products/{product_name}/devices/{identifier}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"device\": {\n \"deployment_group_id\": 1,\n \"description\": \"Example Device\",\n \"tags\": \"prod, customerJNK\",\n \"updates_enabled\": false\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://manage.nervescloud.com/api/orgs/{org_name}/products/{product_name}/devices/{identifier}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"device\": {\n \"deployment_group_id\": 1,\n \"description\": \"Example Device\",\n \"tags\": \"prod, customerJNK\",\n \"updates_enabled\": false\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"connection_status": "connected",
"deployment_group": {
"firmware_uuid": "6fd2bbc8-52b8-4826-5c2a-189968d0de23",
"firmware_version": "1.2.3",
"is_active": true,
"name": "Prod Deployment"
},
"description": "A great device",
"firmware_metadata": {
"architecture": "arm",
"author": "",
"description": "Prod Firmware",
"fwup_version": "1.10.1",
"id": "3f2264c3-cc52-2ba9-b77d-e441f8bb91b6",
"misc": "extra comments",
"platform": "rpi5",
"product": "AmazingProduct",
"uuid": "6fd2bbc8-52b8-4826-5c2a-189968d0de23",
"vcs_identifier": "",
"version": "1.2.3"
},
"identifier": "abc123",
"last_communication": "2050-04-20T00:33:09Z",
"online": true,
"org_name": "BigCompany",
"product_name": "AmazingProduct",
"tags": "prod, customerABC",
"updates_blocked_until": "2050-04-20T00:33:09Z",
"updates_enabled": true,
"version": "1.2.3"
}
}{
"errors": {
"detail": "Resource Not Found or Authorization Insufficient"
}
}{
"errors": {
"detail": "Resource Not Found or Authorization Insufficient"
}
}{
"errors": {
"detail": "Resource Not Found or Authorization Insufficient"
}
}{
"errors": {
"identifier": [
"can't be blank"
]
}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Organization Name
Product Name
Device Identifier
Body
application/json
Device update request body
POST body for updating a Device
Show child attributes
Show child attributes
Response
Device Response
Response schema for a single Device
Show child attributes
Show child attributes
Example:
{
"connection_status": "connected",
"deployment_group": {
"firmware_uuid": "6fd2bbc8-52b8-4826-5c2a-189968d0de23",
"firmware_version": "1.2.3",
"is_active": true,
"name": "Prod Deployment"
},
"description": "A great device",
"firmware_metadata": {
"architecture": "arm",
"author": "",
"description": "Prod Firmware",
"fwup_version": "1.10.1",
"id": "3f2264c3-cc52-2ba9-b77d-e441f8bb91b6",
"misc": "extra comments",
"platform": "rpi5",
"product": "AmazingProduct",
"uuid": "6fd2bbc8-52b8-4826-5c2a-189968d0de23",
"vcs_identifier": "",
"version": "1.2.3"
},
"identifier": "abc123",
"last_communication": "2050-04-20T00:33:09Z",
"online": true,
"org_name": "BigCompany",
"product_name": "AmazingProduct",
"tags": "prod, customerABC",
"updates_blocked_until": "2050-04-20T00:33:09Z",
"updates_enabled": true,
"version": "1.2.3"
}

