How to create flespi devices in bulk?

Five ways for the massive creation of devices in the flespi platform.

Sometimes you want to add a few dozens or hundreds of devices into the flespi platform (e.g. a fleet). The standard method of clicking the “+” button in the Telematics hub -> Devices section will take ages with such volumes.

For such cases, flespi offers five options to create devices in bulk:

1. Use a REST API method 

The following POST method is used to create flespi devices: https://flespi.io/docs/#/gw/!/devices/post_devices

flespi post devices method rest API

This approach is the most flexible but requires scripting from you.

result of post device request rest API

2. "Create devices" button on the Connections tab of the Channel card

This is a GUI-based method, but it also accepts idents in the CSV format. 

device card connections tab create devices

You can add idents manually into the input field or use the “CSV input” button to speed up the process. To use this approach, you may generate a CSV string and paste into the required field:

add idents as csv to create devices

3. "Create devices" button on the Idents tab of the Channel card

This is another GUI-based: there is an Idents tab (next to the Connections tab), which stores idents of devices extracted from the saved traffic in the given channel (the rotation of the saved traffic depends on the volume of data in the channel). If you click on the "Create devices" button on the right, you will be offered to create the flespi devices for all listed idents.

You can leave only the ones you need, pick the proper device type from the drop-down and click the "+" button to initiate bulk device creation: 

4. "Create webhook for devices auto-creation" button on the Idents tab of the Channel card

You can automate the creation of new devices using a special webhook. Navigate to the Idents tab for the target channel and click the orange button with the webhook icon on the right:

create webhook for devices auto creation

Then you will be offered to pick a specific device type that will be assigned to all auto-created devices (currently we cannot guess it):

pick device type for auto created devices

Check the webhook configuration and confirm webhook creation by clicking Save:

configure webhook for devices auto creation

That's it — the webhook will trigger once the new ident is registered in the target channel.

5. Use a tool written by one of the flespi developers

Here is the source code of a small but handy tool that can automate the creation of devices for your account. In essence, it's a helper for creating devices via the REST API (in option 1). You may run it directly in your browser.

Just copy the required idents from Excel (or any other tool containing a column of idents) and paste them into the input.

flespi bulk device creation tool

Then you will also be able to specify the phone numbers for the devices if necessary and set the messages TTL period.

The tool will then offer you a generated JSON for revision. If it looks OK to you, just click the Create devices button at the bottom to make it happen.

check json and create flespi devices automatically

***

Pick the option that you find the most convenient.


See also
A comprehensive guide on the key concepts and principles of the flespi analytics engine.
Restore your accidentally deleted items within a 30-day period.