Automatic Device and Application Registration

Hello Community.
I have created a flask API to create a new application and device into chirpstack.
However, there is manual intervention needed to provide the device profiles for ABP and OTAA and service profile IDs. For now, what I am doing is that I am creating a dummy application and device and tapping into the RestApi to obtain their Ids. The next devices can thus be created by a python script with preset profile Ids. Is there a way the first step can be automated? Thanks in advance for your help.