Bulk Create Devices

This endpoint creates multiple new Devices.

Request

To create multiple new Devices please make a POST request to the following URL:

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

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 body parameters:

ParameterTypeRequired?Default ValueDescription
labelStringYesN/A (required)API label of Device
nameStringNoSame as labelName of Device
descriptionStringNo""Description of Device
tagsString ArrayNo[ ]Device tags
propertiesObjectNo{ }Device properties. Allowed attributes: _icon, _color, _location_type, _location_variable (label of Variable), _location_fixed, _config
organizationStringNonullOrganization of Device

Header

📘

Don't forget

Please note that the X-Bulk-Operation header attribute is necessary Learn more.

ParameterTypeDescription
X-Auth-TokenString[Authentication Token] (/reference/authentication) of account
X-Bulk-OperationBooleanNeed to be set to True for the bulk operation to work
Content-TypeString (application/json)Content type of body
curl -X POST 'https://industrial.api.ubidots.com/api/v2.0/devices/_/bulk/create/' \
 -H 'Content-Type: application/json' \
 -H 'X-Auth-Token: oaXBo6ODhIjPsusNRPUGIK4d72bc73' \
 -H 'X-Bulk-Operation: True' \
 -d '[
  	 {
            "label": "device_1",
            "properties": {
              "_location_type":"manual",
              "_location_fixed": { 
                  "lat": 6.2486, 
                  "lng": 75.5742 
              	} 
          	}
 		},
        {
            "label": "device_2",
            "tags": ["Colombia", "Medellin", "IoTIsGreat"]
        },
        {
            "label": "device_3",
            "properties": {},
            "description":"This is the description for device_3"
        }
     ]'
{
    "task": {
        "id": "5f208f564763e74744b2ba87"
    }
}
{
    "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.