Overview
Assigns multiple devices to a single customer in one request. This is the bulk variant for assigning devices — use this when provisioning several devices for the same customer.
Features:
Assign multiple devices to one customer in a single call
Auto-creates the customer if they don’t exist
Optional auto-create for devices (requires deviceType)
Reports which devices were newly assigned, already assigned, or skipped
Authentication
Your organization’s API key
Request Body
The email address of the customer to assign devices to. Must be a valid email format.
Array of device identifiers (e.g., serial numbers, MAC addresses) to assign. Must be a non-empty array.
If true, creates devices automatically if they don’t exist in the system. Defaults to false.
Required when autoCreateDevices is true . Specifies the device type (e.g., “sensor”, “Thermostat”, “Gateway”).
Response
Indicates if the operation was successful
Description of the operation result
The unique identifier of the customer in Telemetron
Indicates whether the customer was created during this operation
Array of devices that were newly assigned in this request The device’s unique ID in Telemetron
Indicates if this device was created during this operation
Array of devices that were already assigned to this customer (no-op) The device’s unique ID in Telemetron
Indicates if this device was created during this operation
Array of device identifier strings that were not found in the system (when autoCreateDevices is false)
Examples
Basic Bulk Assignment
curl -X POST https://admin.telemetron.ai/api/ext-v1/deviceAssignment/assignDevicesToOwner \
-H "x-api-key: your_api_key_here" \
-H "Content-Type: application/json" \
-d '{
"customerEmail": "john.doe@example.com",
"deviceIdentifiers": ["SN-001", "SN-002", "SN-003"]
}'
With Auto-Create Devices
curl -X POST https://admin.telemetron.ai/api/ext-v1/deviceAssignment/assignDevicesToOwner \
-H "x-api-key: your_api_key_here" \
-H "Content-Type: application/json" \
-d '{
"customerEmail": "john.doe@example.com",
"deviceIdentifiers": ["SN-001", "SN-002"],
"autoCreateDevices": true,
"deviceType": "sensor"
}'
Response
Success - Mixed Results
Success - New Customer
Error - Invalid Input
{
"success" : true ,
"message" : "Successfully assigned 2 device(s) to customer" ,
"customerId" : "cust_abc123" ,
"customerWasCreated" : false ,
"assignedDevices" : [
{ "identifier" : "SN-001" , "deviceId" : "dev_x1y2z3" , "wasCreated" : false }
],
"alreadyAssigned" : [
{ "identifier" : "SN-002" , "deviceId" : "dev_a4b5c6" , "wasCreated" : false }
],
"skipped" : [ "SN-003" ]
}
cURL - Basic Bulk Assignment
cURL - With Auto-Create
JavaScript - Basic Bulk Assignment
JavaScript - With Auto-Create
Python - Basic Bulk Assignment
Python - With Auto-Create
curl -X POST https://admin.telemetron.ai/api/ext-v1/deviceAssignment/assignDevicesToOwner \
-H "x-api-key: your_api_key_here" \
-H "Content-Type: application/json" \
-d '{
"customerEmail": "john.doe@example.com",
"deviceIdentifiers": ["SN-001", "SN-002", "SN-003"]
}'
Success - Mixed Results
Success - All Assigned
Error - No Valid Devices
Error - Missing Device Type
{
"success" : true ,
"message" : "Successfully assigned 2 device(s) to customer" ,
"customerId" : "cust_abc123" ,
"customerWasCreated" : false ,
"assignedDevices" : [
{ "identifier" : "SN-001" , "deviceId" : "dev_x1y2z3" , "wasCreated" : false }
],
"alreadyAssigned" : [
{ "identifier" : "SN-002" , "deviceId" : "dev_a4b5c6" , "wasCreated" : false }
],
"skipped" : [ "SN-003" ]
}
Status Codes
Code Description 200 Devices successfully assigned to customer 400 Invalid request (missing required fields, empty array, or no valid devices) 401 Invalid or missing API key 500 Internal server error
Implementation Notes
Idempotent : Devices already assigned to the customer are reported in alreadyAssigned — no duplicates are created
Auto-create customer : The customer is automatically created if they don’t exist
Partial success : The response details which devices were assigned, already assigned, or skipped, allowing you to handle each case
Skipped devices : When autoCreateDevices is false, unknown device identifiers are returned in the skipped array
Required : When autoCreateDevices is true, you must provide deviceType or the request will fail with a 400 error.