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?

  • Drupal has a REST API. Why are you building a custom one?
    – cilefen
    Nov 11, 2023 at 14:11
  • I'm using same one entity/user (sorry, not user/entity edited the question) which is default API in Drupal 10, I wanted to send a better messages back to API response when its get failed
    – veera
    Nov 11, 2023 at 15:02
  • Better than what?
    – cilefen
    Nov 11, 2023 at 15:41


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.