Roll back a group of devices to their previous application version
POST
/api/v1/devices/rollback-version
const url = 'http://localhost:3000/api/v1/devices/rollback-version';const options = { method: 'POST', headers: {'X-API-Key': '<X-API-Key>', 'Content-Type': 'application/json'}, body: '{"deviceSelector":{"matchLabels":{"site":"plant-a"},"matchExpressions":[{"key":"line","operator":"In","values":["line-3"]}]},"reason":"example","applicationPackageId":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url http://localhost:3000/api/v1/devices/rollback-version \ --header 'Content-Type: application/json' \ --header 'X-API-Key: <X-API-Key>' \ --data '{ "deviceSelector": { "matchLabels": { "site": "plant-a" }, "matchExpressions": [ { "key": "line", "operator": "In", "values": [ "line-3" ] } ] }, "reason": "example", "applicationPackageId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0" }'Redeploys the application version each matching device ran before its current one. Devices with no distinct previous version are reported as skipped rather than failing the batch. This does not abort an in-flight rollout — see the deployment rollback route.
Authorizations
Section titled “Authorizations ”Request Body required
Section titled “Request Body required ” Media type application/json
object
deviceSelector
required
Label selector choosing which devices to roll back
object
matchLabels
Exact label equality match; all entries must match (AND).
object
Example
{ "site": "plant-a"} matchExpressions
Array<object>
object
key
required
Label key to match on
string
Example
line operator
required
string
Example
In values
Array<string>
Example
[ "line-3"] reason
Operator-supplied reason, recorded on the audit entry
string
applicationPackageId
Which application package to roll back on every matching device.
string format: uuid
Responses
Section titled “ Responses ”Rollback evaluated for every matching device
DeviceSelector missing or malformed
Forbidden — caller lacks required permission
No devices matched the selector