---
agentTools:
  projectIndex: https://meshblu-socketio.readme.io/llms.txt
---

# Update

Update a device record

Update a device in the Meshblu device registry. In order to update a target device, your connection must be authenticated as a device that is in the target device's `configure.update` whitelist. See the [Meshblu whitelist documentation](https://meshblu.readme.io/docs/whitelists-2-0) for more information.

### Event: `"update"`, `query`, `callback`

* `query/update` Both the query and update object. Must contain at least a `uuid`. Other than the listed exceptions, all other parameters will overwrite the device in the registry.
  * `uuid` UUID of the device to update. If omitted, it defaults to the UUID of the authenticated connection.
* `callback` Function that will be called with a `result`.
  * `result` Object passed to the callback.
    * `uuid` The uuid of the device that was updated.
    * `status` Status code of the update operation. Will always be `200`, even if the update did not happen.

[block:callout]
{
  "type": "danger",
  "title": "Risk of Overwrite",
  "body": "v1.0 of update does not allow for atomic updates using the '$' prefix operators. This means you may run into the classic Read Write race condition. See the [HTTP](https://meshblu-http.readme.io/) or [XMPP](https://meshblu-xmpp.readme.io/) APIs if you need of that functionality."
}
[/block]

[block:api-header]
{
  "type": "basic",
  "title": "Successful Response"
}
[/block]

[block:code]
{
  "codes": [
    {
      "code": "{\n  \"uuid\": \"78159106-41ca-4022-95e8-2511695ce64c\",\n  \"status\": 200\n}\n",
      "language": "json",
      "name": "response.json"
    }
  ]
}
[/block]

[block:api-header]
{
  "type": "basic",
  "title": "Error Response"
}
[/block]

[block:code]
{
  "codes": [
    {
      "code": "{\n  \"uuid\": \"i-made-this-uuid-up\",\n  \"status\": 200\n}\n",
      "language": "json",
      "name": "error-response.json"
    }
  ]
}
[/block]