title: REST HTTP status code if DELETE impossible
body: <p>My question is quite a generic one about HTTP status code when a <strong>DELETE</strong> is impossible on the resource (but not regarding user's rights).</p>
  
  <p>We have a RESTful API on a type of resource.</p>
  
  <p>The <strong>DELETE</strong> method is authorized on the resource however under some conditions a resource cannot be deleted (if there are data binded to this resource).</p>
  
  <p>What is the correct HTTP status code to return to the client in this situation?</p>
  
  <p>Here are some of the possibilities I gathered and why it seems inappropriate in my case :</p>
  
  <ul>
  <li><strong>403</strong> (<em>Forbidden</em>) : Seems mostly related with user's rights.</li>
  <li><strong>405</strong> (<em>Method Not Allowed</em>) : Seems like the API is not designed to respond to this method for this type of resource.</li>
  <li><strong>409</strong> (<em>Conflict</em>) : Seems appropriate but the client should have the possibility to resolve the conflict with the API but that's not the case here.</li>
  </ul>
  
  <p><strong>Update :</strong> The data binding that prevents the resource  to be deleted cannot be changed via the REST API. However the resource can be "freed" via other way as the database from which the data comes from is also accessed by other apps that may change the state of a resource (an SQL DELETE in the DB can always do that).</p>