Roll back a device to its previous application version
POST
/api/v1/devices/{id}/rollback-version
const url = 'http://localhost:3000/api/v1/devices/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/rollback-version';const options = { method: 'POST', headers: {'X-API-Key': '<X-API-Key>', 'Content-Type': 'application/json'}, body: '{"reason":"v2.4.1 crash-looping on the line-3 gateways","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/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/rollback-version \ --header 'Content-Type: application/json' \ --header 'X-API-Key: <X-API-Key>' \ --data '{ "reason": "v2.4.1 crash-looping on the line-3 gateways", "applicationPackageId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0" }'Redeploys the application version this device ran before its current one, producing a new manifest version (never reusing or decrementing). Returns 409 when the device has no distinct previous version. This does not abort an in-flight rollout.
Authorizations
Section titled “Authorizations ”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters ” id
required
string format: uuid
Device UUID
Request Body required
Section titled “Request Body required ” Media type application/json
object
reason
Operator-supplied reason, recorded on the audit entry
string
Example
v2.4.1 crash-looping on the line-3 gateways applicationPackageId
Which application to roll back. Rollback is scoped to one application package; on a device running several, omitting this picks the most recently sealed rollbackable one.
string format: uuid
Responses
Section titled “ Responses ”Device rolled back to its previous version
Forbidden — caller lacks required permission
Device not found
No previous version to roll back to