Bulk Create/Edit/Delete devices via CSV file

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 NameRequired (Create)Required (Update/Delete)Format
1Device NameYesNoText
2Device Unique IDYesYesText (MAC address format recommended)
3Serial NumberNoNoText
4LocationNoNoText
5Account IDYesYesValid Account/Company ID
6Device Type IDYesNoValid Device Type ID
7Heartbeat Period (second)YesNoInteger >= 0 (0 means not set)
8Device Cell NumberNoNoText
9SMS Command PasswordNoNoText
10Device Config IDNoNoDevice Config ID or name
11ActiveNoNotrue, false, or empty (default: true)
12Heartbeat ValuesNoNoComma-separated values
13Device Integration IDNoNoValid Integration ID
14Cloud Native Integration IDNoNoValid Cloud Native Integration ID
15Parent Device IDNoNoValid Device ID (for attached endpoints)
16TagsNoNoSemicolon-separated tags (e.g., tag1;tag2)
17MetadataNoNoSemicolon-separated key:value pairs (e.g., key1:value1;key2:value2)
18Enforce Secure MQTTNoNotrue, false, or empty
19MQTT PasswordNoNoText (leave blank for default)
20Delete?NoNotrue to delete device, false or empty otherwise
21Update?NoNotrue to update device, false or empty otherwise
22ICCID (SIM)NoNo18-22 digits. Globally unique. Triggers SIM creation when non-empty.
23MSISDN (SIM)NoNoPhone number associated with the SIM.
24Communication Plan (SIM)NoNoCarrier communication plan name.
25Rate Plan (SIM)NoNoCarrier rate plan name.

Operation Types

  • Create: When both Delete and Update columns are false or 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:value pairs 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
Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…
Body Params
file
required

CSV file containing device data

Responses

400

The request was malformed or contained invalid parameters.

401

You are not authorized

403

User does not have access to one or more companies in the CSV

500

An unexpected error was encountered.

Language
Credentials
Header
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json