Bulk Update Devices

This endpoint updates multiple Device fields for multiple Devices.

Request

To update one or more specific attributes of one or more Device(s) please make a PATCH request to the following URL:

HTTP MethodURL
PATCHhttps://industrial.api.ubidots.com/api/v2.0/devices/_/bulk/update/

Query Parameters

ParameterTypeUseDescription
tokenStringAuthenticationAuthentication Token can optionally be sent as a query parameter.

Body Parameters

The body is an Array containing Device JSON objects. Each Device object can contain the following any of the following body parameters:

ParameterTypeRequired?Description
idStringYesThe Device ID
labelStringNoThe API label of Device
nameStringNoName of the Device
descriptionStringNoDescription of Device
tagsString ArrayNoDevice tags
propertiesObjectNoDevice properties
organization<organization_key>NoKey of Organization (id or label)

Header

ParameterRequired?Description
X-Auth-TokenYes[Authentication Token] (/reference/authentication) of account
X-Bulk-OperationYesNeed to be set to True for the bulk operation to work
Content-TypeYesContent type of body
$ curl -X PATCH 'https://industrial.api.ubidots.com/api/v2.0/devices/_/bulk/update/' \
 -H 'Content-Type: application/json' \
 -H 'X-Auth-Token: oaXBo6ODhIjPsusNRPUGIK4d72bc73' \
 -H 'X-Bulk-Operation: True' \
 -d '[
  {
    "id": "5df7b9c01a9ca5714e7a1305",
    "name": "device 1"
  },
...
  {
    "id": "rgnbj7809ca5pIhpjgc345fc",
    "name": "device 4"
  }
]'
{
  "task": {
    "id": "tyg54645501a9ca5714e7b098721"
  }
}
{
    "code": 400001,
    "message": "Validation Error.",
    "detail": {
        ....
    }
}
{
    "code": 401001,
    "message": "Authentication credentials were not provided.",
    "detail": "Authentication credentials were not provided."
}
{
    "detail": "Header `X-BULK-OPERATION` should be provided for bulk operation."
}

Response

Returns a Task Id of the asynchronous process.