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

I am having this issue on Process Event Scripts system system.user [POST] system.user system.user.post.post_process
but on service its working fine.