@Augusto Piva Thanks for reaching here! It seems like you are experiencing duplicate registrations when creating an installation using the REST API. This can happen if the installation already exists with the same installation ID and PNS handle. In this case, the existing installation will be overwritten with the new one. However, if the installation does not exist, a new installation will be created.
Regarding the two registrations you are seeing, one with the template and the other without it, it is possible that the installation was created twice with the same installation ID and PNS handle. This can happen if the installation creation request was sent twice or if there was a delay in the response from the server, causing the client to send the request again.
To prevent this from happening, you can try to implement a unique identifier for each installation, such as a GUID, and use it as the installation ID. This will ensure that each installation is unique and prevent duplicates from being created.
Additionally, you can also check if the installation already exists before creating a new one by using the Read Installation API. If the installation already exists, you can update it instead of creating a new one.
I hope this helps! Let me know if you have any further questions.