To assign device number dynamically, create the enrollment QR code in the following way:
1. Open the "Configurations" tab, choose a configuration for the new enrolled devices, and generate the QR code by clicking the QR icon. The QR code will then contain the configuration ID.
2. Choose the device number assignment strategy (available values - User value, IMEI and Serial).
3. Set the "Add to device list if not exists" checkbox. This option will create the devices automatically (the API call will differ from the one you provided).
4. Optionally choose group(s) to which new devices will belong.