You often start with a Free account or a default account in your Commercial plan. Later on, you may want to group your devices by project, by customer, by manager, etc. Flespi offers subaccounts to organize such grouping. Now you need to move the already created devices from the parent account to a subaccount.
You need the following method for that: https://flespi.io/docs/#/gw/devices/put_devices_dev_selector_cid.
Just specify the ids of devices you need to move and the cid of the subaccount to move them to.
You can copy the curl to execute from the terminal or execute the request right in the documentation (beware — it will perform the actual moving).
Important requirements
The device must not be moved/created within the last 60 seconds.
If the device is assigned to a calculator, the new account must have access to this calculator.
If the device is assigned to a stream, the new account must have access to this stream.
If the device is assigned to a plugin, the new account must have access to this plugin.
There should be no MQTT state topic (flespi/state/gw/devices/{device-id}/…) related to the device with a timestamp of more than 60 seconds from the present (especially actual for telemetry values).
Moving devices in UI
flespi panel also features the functionality to move devices between accounts:
- use Ctrl+click to select the desired devices
- click on the purple "Move to subaccount" button
- select the target subaccount from the drop-down list and click Move
Moving channels
You can also move channels from account to subaccount using the following request method: https://flespi.io/docs/#/gw/channels/put_channels_ch_selector_cid.