title: What is the correct HTTP error code to return, 404 vs 412?
body: <p>I am working on designing the REST APIs. One of the POST request to create a room in a home  takes an input of ID of the home and room name like :</p>
  
  <pre><code>POST  /webCall/development/construction
  &lt;?xml version="1.0"?&gt;&lt;room&gt;&lt;home id='110001'/&gt;&lt;name&gt;large bedroom&lt;/name&gt;&lt;/room&gt;
  </code></pre>
  
  <p>So my question here is,suppose the home ID = 110001, doesn't exist in the system, In that case should 404(Resource not found) be the response code or 412(Precondition failed) be the response code.</p>
  
  <p>Possible arguements.</p>
  
  <pre><code>Why 404 : The resource home with ID : 110001 is not found.
  Why 412 : The precondition to create a room is that a home should exist,which fails here.
  </code></pre>
  
  <p>Please provide your suggestions with reasoning, that would help me to take right decision.</p>