title: Is HTTP status 422 appropriate for records that fail uniqueness validation?
body: <p>I've done it a lot of times (and seen many people do so), but I start to wonder if it is appropriate :</p>
  
  <pre><code>if @record.save
    # status 200
  else
    # failure of validations =&gt; status 422
  end
  </code></pre>
  
  <p>Now I see that <code>422 unprocessable entity</code> means the <a href="http://en.wikipedia.org/wiki/List_of_HTTP_status_codes" rel="noreferrer">request was well-formed, but not semantically correct</a>. As I understood it, a validation error may not be a semantic error.</p>
  
  <p><strong>Note:</strong> I'm talking about <strong>uniqueness validations</strong>, so I'm not sure this qualifies as a user error, as in this question : <a href="https://stackoverflow.com/questions/1959947/whats-an-appropriate-http-status-code-to-return-by-a-rest-api-service-for-a-val">What&#39;s an appropriate HTTP status code to return by a REST API service for a validation failure?</a></p>
  
  <p><strong>To sum up: should I stop using status 422 ? If so, what should I use instead ?</strong></p>