When a user submits invalid data to my API (usually via Javascript + JSON), I am wondering which HTTP response code I should reply with.
Should I return a HTTP 200 response with the errors - or should my server respond with a 400 or 500 error since the request actually failed my validation because of some bad data?
It seems like a 400 error is the way to go since "The 4xx class of status code is intended for cases in which the client seems to have erred" - wikipedia
However, one thing to keep in mind is that most people use a framework like jQuery which requires you to specify an alternate callback when AJAX requests respond with any status code other than a 200.