How to create users while registering with different roles via API?

@juniorconte 's way is also not working for me. All the users are getting defaulted to public role. The bug I have observed is platform.session.user is not available during the post process. Everything else is fine. Just because the platform.session.user is not available the if statement fails and we can’t do a patch event.

@aislam Can you please let me know what I need to, which file I need to modify to make this available so that I can get the user id and make a patch event working. Mid march is something which is very far for us.