I'm trying to build a rest API to provide my mobile team to register a user using mobile app. I'm using www.example.com/entity/user for rest API as POST.
I'm able to create the user, but in some cases, the account is not successfully created, for example when the email has been already used for an account. In this case, I need to send out an email with the exact error message.
How can I get the error message returned when the account has not been created?