Bulk Create/Edit/Delete devices via CSV file.
CSV Format
The CSV file must have either 21 columns (device-only, legacy) or 25 columns (device + SIM, EIQ-5996), in the following order:
| # | Column Name | Required (Create) | Required (Update/Delete) | Format |
|---|---|---|---|---|
| 1 | Device Name | Yes | No | Text |
| 2 | Device Unique ID | Yes | Yes | Text (MAC address format recommended) |
| 3 | Serial Number | No | No | Text |
| 4 | Location | No | No | Text |
| 5 | Account ID | Yes | Yes | Valid Account/Company ID |
| 6 | Device Type ID | Yes | No | Valid Device Type ID |
| 7 | Heartbeat Period (second) | Yes | No | Integer >= 0 (0 means not set) |
| 8 | Device Cell Number | No | No | Text |
| 9 | SMS Command Password | No | No | Text |
| 10 | Device Config ID | No | No | Device Config ID or name |
| 11 | Active | No | No | true, false, or empty (default: true) |
| 12 | Heartbeat Values | No | No | Comma-separated values |
| 13 | Device Integration ID | No | No | Valid Integration ID |
| 14 | Cloud Native Integration ID | No | No | Valid Cloud Native Integration ID |
| 15 | Parent Device ID | No | No | Valid Device ID (for attached endpoints) |
| 16 | Tags | No | No | Semicolon-separated tags (e.g., tag1;tag2) |
| 17 | Metadata | No | No | Semicolon-separated key:value pairs (e.g., key1:value1;key2:value2) |
| 18 | Enforce Secure MQTT | No | No | true, false, or empty |
| 19 | MQTT Password | No | No | Text (leave blank for default) |
| 20 | Delete? | No | No | true to delete device, false or empty otherwise |
| 21 | Update? | No | No | true to update device, false or empty otherwise |
| 22 | ICCID (SIM) | No | No | 18-22 digits. Globally unique. Triggers SIM creation when non-empty. |
| 23 | MSISDN (SIM) | No | No | Phone number associated with the SIM. |
| 24 | Communication Plan (SIM) | No | No | Carrier communication plan name. |
| 25 | Rate Plan (SIM) | No | No | Carrier rate plan name. |
Operation Types
- Create: When both Delete and Update columns are
falseor empty - Update: When Update column is
true - Delete: When Delete column is
true
Note: Delete and Update cannot both be true for the same row.
Validation Rules
- Heartbeat Period: Must be an integer >= 0. Negative values are not allowed. Value of 0 is treated as "not set".
- Boolean fields (Active, Enforce Secure MQTT, Delete, Update): Must be
true,false, or empty. - Metadata: Must be in format
key:valuepairs separated by semicolons. - Tags: Semicolon-separated list of tag names.
- ICCID (SIM): When provided, must be 18-22 digits and unique platform-wide.
SIM behavior (25-column variant only)
- Create row + ICCID populated: device is created and a SIM is created and linked to it.
- Create row + SIM fields populated but ICCID empty: device is created, no SIM is created
(a warning is raised by
/devices/csv_validate). - Update row + ICCID populated, no SIM exists: device is updated and a new SIM is created.
- Update row + ICCID populated, SIM already exists: device is updated and the existing SIM is updated in place (its id is preserved).
- Update row + ICCID empty: device is updated; the existing SIM (if any) is left untouched.
- Delete row: device is deleted; any associated SIM is removed automatically by FK cascade.
Atomicity
Device + SIM creation is atomic per row. If the SIM cannot be created or updated (validation error, ICCID conflict, DB error), the device write is rolled back so we never leave an orphan device. The row is reported as failed in the bulk response.
Bulk response summary
The bulk_response.metadata JSONB field is populated with SIM-specific counters
when SIM-related work happened during the import:
{
"metadata": {
"sims_created": 10,
"sims_updated": 3,
"sims_deleted": 1,
"sims_failed": 0
}
}
Update Behavior
When updating devices, the following fields are replaced (not merged):
- Tags: The entire tags list is replaced with the values from the CSV. To add a new tag while keeping existing ones, include all existing tags plus the new one in the CSV.
- Metadata: The entire metadata object is replaced with the values from the CSV. To add a new key while keeping existing ones, include all existing key:value pairs plus the new one in the CSV.
If these columns are left empty during an update, the existing values are preserved.
Limits
- Maximum 1000 devices per upload
| Time | Status | User Agent | |
|---|---|---|---|
Retrieving recent requests… | |||
400The request was malformed or contained invalid parameters.
401You are not authorized
403User does not have access to one or more companies in the CSV
500An unexpected error was encountered.