curl --request PATCH \
--url https://api.getprimo.com/devices \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"items": [
{
"deviceId": "<string>",
"purchaseDate": "2023-12-25",
"decommissioningDate": "2023-12-25",
"purchasePriceNoVAT": 0,
"ownerId": "<string>",
"name": "<string>",
"assetId": "<string>",
"inchScreenSize": 123,
"brand": "<string>",
"modelName": "<string>",
"year": 0,
"serialNumber": "<string>",
"modelIdentifier": "<string>",
"processor": "<string>",
"ram": 0,
"storage": 0
}
]
}
'import requests
url = "https://api.getprimo.com/devices"
payload = { "items": [
{
"deviceId": "<string>",
"purchaseDate": "2023-12-25",
"decommissioningDate": "2023-12-25",
"purchasePriceNoVAT": 0,
"ownerId": "<string>",
"name": "<string>",
"assetId": "<string>",
"inchScreenSize": 123,
"brand": "<string>",
"modelName": "<string>",
"year": 0,
"serialNumber": "<string>",
"modelIdentifier": "<string>",
"processor": "<string>",
"ram": 0,
"storage": 0
}
] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
items: [
{
deviceId: '<string>',
purchaseDate: '2023-12-25',
decommissioningDate: '2023-12-25',
purchasePriceNoVAT: 0,
ownerId: '<string>',
name: '<string>',
assetId: '<string>',
inchScreenSize: 123,
brand: '<string>',
modelName: '<string>',
year: 0,
serialNumber: '<string>',
modelIdentifier: '<string>',
processor: '<string>',
ram: 0,
storage: 0
}
]
})
};
fetch('https://api.getprimo.com/devices', 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://api.getprimo.com/devices",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'items' => [
[
'deviceId' => '<string>',
'purchaseDate' => '2023-12-25',
'decommissioningDate' => '2023-12-25',
'purchasePriceNoVAT' => 0,
'ownerId' => '<string>',
'name' => '<string>',
'assetId' => '<string>',
'inchScreenSize' => 123,
'brand' => '<string>',
'modelName' => '<string>',
'year' => 0,
'serialNumber' => '<string>',
'modelIdentifier' => '<string>',
'processor' => '<string>',
'ram' => 0,
'storage' => 0
]
]
]),
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://api.getprimo.com/devices"
payload := strings.NewReader("{\n \"items\": [\n {\n \"deviceId\": \"<string>\",\n \"purchaseDate\": \"2023-12-25\",\n \"decommissioningDate\": \"2023-12-25\",\n \"purchasePriceNoVAT\": 0,\n \"ownerId\": \"<string>\",\n \"name\": \"<string>\",\n \"assetId\": \"<string>\",\n \"inchScreenSize\": 123,\n \"brand\": \"<string>\",\n \"modelName\": \"<string>\",\n \"year\": 0,\n \"serialNumber\": \"<string>\",\n \"modelIdentifier\": \"<string>\",\n \"processor\": \"<string>\",\n \"ram\": 0,\n \"storage\": 0\n }\n ]\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.getprimo.com/devices")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"items\": [\n {\n \"deviceId\": \"<string>\",\n \"purchaseDate\": \"2023-12-25\",\n \"decommissioningDate\": \"2023-12-25\",\n \"purchasePriceNoVAT\": 0,\n \"ownerId\": \"<string>\",\n \"name\": \"<string>\",\n \"assetId\": \"<string>\",\n \"inchScreenSize\": 123,\n \"brand\": \"<string>\",\n \"modelName\": \"<string>\",\n \"year\": 0,\n \"serialNumber\": \"<string>\",\n \"modelIdentifier\": \"<string>\",\n \"processor\": \"<string>\",\n \"ram\": 0,\n \"storage\": 0\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.getprimo.com/devices")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"items\": [\n {\n \"deviceId\": \"<string>\",\n \"purchaseDate\": \"2023-12-25\",\n \"decommissioningDate\": \"2023-12-25\",\n \"purchasePriceNoVAT\": 0,\n \"ownerId\": \"<string>\",\n \"name\": \"<string>\",\n \"assetId\": \"<string>\",\n \"inchScreenSize\": 123,\n \"brand\": \"<string>\",\n \"modelName\": \"<string>\",\n \"year\": 0,\n \"serialNumber\": \"<string>\",\n \"modelIdentifier\": \"<string>\",\n \"processor\": \"<string>\",\n \"ram\": 0,\n \"storage\": 0\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"successCount": 0,
"failureCount": 0,
"results": [
{
"deviceId": "<string>",
"errorCode": "<string>",
"message": "<string>"
}
]
}Update several devices
Update the inventory data of MULTIPLE devices in one call — the batch form of updateDevice, with the same fields and the same rules per device. Provide a list of items, each targeting one deviceId (up to 100 per call, each device at most once). Writes are independent and best-effort: the call returns 200 with a results manifest reporting ok / error per device — always inspect results rather than relying on the HTTP status to detect partial failures. Prefer this over calling updateDevice once per device; use updateDevice for a single device, when you want the updated device back or a failure to surface as an HTTP error.
curl --request PATCH \
--url https://api.getprimo.com/devices \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"items": [
{
"deviceId": "<string>",
"purchaseDate": "2023-12-25",
"decommissioningDate": "2023-12-25",
"purchasePriceNoVAT": 0,
"ownerId": "<string>",
"name": "<string>",
"assetId": "<string>",
"inchScreenSize": 123,
"brand": "<string>",
"modelName": "<string>",
"year": 0,
"serialNumber": "<string>",
"modelIdentifier": "<string>",
"processor": "<string>",
"ram": 0,
"storage": 0
}
]
}
'import requests
url = "https://api.getprimo.com/devices"
payload = { "items": [
{
"deviceId": "<string>",
"purchaseDate": "2023-12-25",
"decommissioningDate": "2023-12-25",
"purchasePriceNoVAT": 0,
"ownerId": "<string>",
"name": "<string>",
"assetId": "<string>",
"inchScreenSize": 123,
"brand": "<string>",
"modelName": "<string>",
"year": 0,
"serialNumber": "<string>",
"modelIdentifier": "<string>",
"processor": "<string>",
"ram": 0,
"storage": 0
}
] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
items: [
{
deviceId: '<string>',
purchaseDate: '2023-12-25',
decommissioningDate: '2023-12-25',
purchasePriceNoVAT: 0,
ownerId: '<string>',
name: '<string>',
assetId: '<string>',
inchScreenSize: 123,
brand: '<string>',
modelName: '<string>',
year: 0,
serialNumber: '<string>',
modelIdentifier: '<string>',
processor: '<string>',
ram: 0,
storage: 0
}
]
})
};
fetch('https://api.getprimo.com/devices', 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://api.getprimo.com/devices",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'items' => [
[
'deviceId' => '<string>',
'purchaseDate' => '2023-12-25',
'decommissioningDate' => '2023-12-25',
'purchasePriceNoVAT' => 0,
'ownerId' => '<string>',
'name' => '<string>',
'assetId' => '<string>',
'inchScreenSize' => 123,
'brand' => '<string>',
'modelName' => '<string>',
'year' => 0,
'serialNumber' => '<string>',
'modelIdentifier' => '<string>',
'processor' => '<string>',
'ram' => 0,
'storage' => 0
]
]
]),
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://api.getprimo.com/devices"
payload := strings.NewReader("{\n \"items\": [\n {\n \"deviceId\": \"<string>\",\n \"purchaseDate\": \"2023-12-25\",\n \"decommissioningDate\": \"2023-12-25\",\n \"purchasePriceNoVAT\": 0,\n \"ownerId\": \"<string>\",\n \"name\": \"<string>\",\n \"assetId\": \"<string>\",\n \"inchScreenSize\": 123,\n \"brand\": \"<string>\",\n \"modelName\": \"<string>\",\n \"year\": 0,\n \"serialNumber\": \"<string>\",\n \"modelIdentifier\": \"<string>\",\n \"processor\": \"<string>\",\n \"ram\": 0,\n \"storage\": 0\n }\n ]\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.getprimo.com/devices")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"items\": [\n {\n \"deviceId\": \"<string>\",\n \"purchaseDate\": \"2023-12-25\",\n \"decommissioningDate\": \"2023-12-25\",\n \"purchasePriceNoVAT\": 0,\n \"ownerId\": \"<string>\",\n \"name\": \"<string>\",\n \"assetId\": \"<string>\",\n \"inchScreenSize\": 123,\n \"brand\": \"<string>\",\n \"modelName\": \"<string>\",\n \"year\": 0,\n \"serialNumber\": \"<string>\",\n \"modelIdentifier\": \"<string>\",\n \"processor\": \"<string>\",\n \"ram\": 0,\n \"storage\": 0\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.getprimo.com/devices")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"items\": [\n {\n \"deviceId\": \"<string>\",\n \"purchaseDate\": \"2023-12-25\",\n \"decommissioningDate\": \"2023-12-25\",\n \"purchasePriceNoVAT\": 0,\n \"ownerId\": \"<string>\",\n \"name\": \"<string>\",\n \"assetId\": \"<string>\",\n \"inchScreenSize\": 123,\n \"brand\": \"<string>\",\n \"modelName\": \"<string>\",\n \"year\": 0,\n \"serialNumber\": \"<string>\",\n \"modelIdentifier\": \"<string>\",\n \"processor\": \"<string>\",\n \"ram\": 0,\n \"storage\": 0\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"successCount": 0,
"failureCount": 0,
"results": [
{
"deviceId": "<string>",
"errorCode": "<string>",
"message": "<string>"
}
]
}Authorizations
Use your Primo API key in the Authorization header as Bearer <API_KEY>.
Body
Device updates to apply. Each item targets one deviceId, which must be unique within the batch, and carries the same fields as updateDevice. Up to 100 items per call. Writes are best-effort: inspect the per-item results to learn which succeeded — the HTTP status is 200 even when some items fail.
1 - 100 elementsShow child attributes
Show child attributes
Response
Number of devices updated successfully.
-9007199254740991 <= x <= 9007199254740991Number of devices that failed to update.
-9007199254740991 <= x <= 9007199254740991Per-item outcome, in the same order as the input items.
Show child attributes
Show child attributes
Was this page helpful?