how to Upgrade Firebase auth to Identity Platform via api rest?

I’m trying to implement an application that deploys a new Firebase project as it is sold, but I need to use cloud functions and blocking services that require Firebase with Identity Platform. I’m aware of the costs and the need for a billing account and this is not a problem. It is quite easy to make this through Firebase Console, but I need to make it programmatically. I look it up on both API REST and SDKs documentation and couldn’t figure out a way of doing that. Can anyone help me?

I got it done with this: https://cloud.google.com/identity-platform/docs/reference/rest/v2/projects.identityPlatform/initializeAuth

you just need to initializeAuth