title: RESTful Soft Delete
body: <p>I'm trying to build a RESTful webapp wherein I utilize GET, POST, PUT, and DELETE. But I had a question about the use of DELETE in this particular app.</p>
  
  <p>A bit of background first:</p>
  
  <p>My webapp manages generic entities that are also managed (and, it happens, always created) in another system. So within my webapp, each entity will be stored in the database with a unique key. But the way we will be accessing them through URLs is with the unique key of the <em>other</em> system.</p>
  
  <p>A simple example will make this clear, I think. Take the URL <code>/entity/1</code>. This will display information for the entity with ID 1 <em>in the other system</em>, and not my own system. In fact, IDs in my system will be completely hidden. There will be no URL scheme for accessing the entity with ID of <code>1</code> in my own system.</p>
  
  <p>Alright, so now that we know how my webapp is structured, let's return to deleting those entities.</p>
  
  <p>There will be a way to 'delete' entities in my system, but I put quotes around it because it won't actually be deleting them from the database. Rather, it will flag them with a property that prevents it from appearing when you go to <code>/entity/1</code>.</p>
  
  <p>Because of this, I feel like I should be using <code>PUT</code> ('deleting' in this way will be idempotent), since I am, from the perspective of the data, simply setting a property.</p>
  
  <p>So, the question: does the RESTful approach have fidelity to the data (in which case it is clear that I am <code>PUT</code>ing), or the representation of the data in the app (in which case it seems that I am <code>DELETE</code>ing)?</p>