REST response code for invalid data

What response code should be passed to client in case of following scenarios?

  1. Invalid data passed while user registration like wrong email format
  2. User name/ Email is already exists

I chose 403. I also found following that I feel can be used.

Wikipedia:

412 Precondition Failed :
The server does not meet one of the preconditions that the requester
put on the request

Suggest code if I should use other than 403.

4 Answers
4

Leave a Comment