Update the State of an nRF9x Device
PATCH/v1/organizations/:organization_slug/projects/:project_slug/long-range/devices/:device_id/state
Send this request to https://api.nrfcloud.com, not the default Memfault API host.
Update the desired and/or reported state of a single nRF9x Device in a given Project. The patch is merged into the existing state, and a key set to null is deleted.
Requires an Organization Auth Token with the device:write permission.
Each side of the patch is validated against the device state constraints below. Paths not listed are not constrained. All violations are reported in a single 422 response and the state is left untouched.
| Path | desired | reported | Value type |
|---|---|---|---|
pairing | Read-only | Read-only | Any |
nrfcloud_mqtt_topic_prefix | Read-only | Read-only | Any |
connection | Read-only | Read-only | Any |
device | Read-only | Writable | Any |
control.alertsEn | Writable | Writable | Boolean |
control.logLvl | Writable | Writable | Integer |
Read-only paths are owned by the platform and are rejected unless force=true is set. The value type is always checked, including with force=true. Setting a typed path to null deletes it and is accepted.
Request
Responses
- 202
- 400
- 403
- 404
- 422
Accepted
Bad Request. The body is not valid JSON.
Forbidden. The token lacks the device:write permission.
Not Found
Unprocessable Entity. The patch breaks the device state constraints.