Bulk Update Devices

This endpoint updates all Device fields for multiple Devices.

📘

Updating a Single Field

To update only a single field of a Device, please use the PATCH method with the parameters that need to be changed.

Request

To update all attributes of a Device please make a POST request to the following URL:

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

🚧

It's a POST

Please note that it's a POST request and not a PUT request.

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
labelStringYesThe 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-TokenYesAuthentication Token of account
X-Bulk-OperationYesNeed to be set to True for the bulk operation to work
Content-TypeYesContent type of body
$ curl -X POST '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": "5fe3a56573efc32098765432",
    "label": "device0",
    "name": "Devive 0",
    "description": "My Device Zero",
    "organization": "~my_organization",
    "properties": {
        "_color": "#3BA9F5",
        "_config": {
            "number": {
                "text": "number1",
                "type": "text"
            }
        },
        "_device_type": "assign-group-0",
        "_icon": null,
        "me_prop": "",
        "number": "3891234567"
    },
    "tags": ["black"],
  },
...
  {
    "id": "5fe3a56573efc32abcd12345",
    "label": "device1",
    "name": "Devive 1",
    "description": "My Device One",
    "organization": "~my_organization",
    "properties": {
        "_color": "#3BA9F5",
        "_config": {
            "number": {
                "text": "number1",
                "type": "text"
            }
        },
        "_device_type": "assign-group-0",
        "_icon": null,
        "me_prop": "",
        "number": "3897654321"
    },
    "tags": ["white"],
  }
]'
{
  "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.