title: How best to design a RESTful API for initiating an action
body: <p>I'm building a RESTful web service that has the usual flavor of CRUD operations for a set of data types. The HTTP verb mappings for these APIs are obvious.</p>
  
  <p>The interesting part comes in where the client can request that a long-running (i.e., hours) operation against one of the data objects be initialized; the status of the operation is reported by querying the data type itself.</p>
  
  <p>For example, assume an object with the following characteristics:</p>
  
  <pre><code>SomeDataType
  {
      Name: "Some name",
      CurrentOperation: "LongOperationA",
      CurrentOperationPercent: 0.75,
      CurrentOperationEtaSeconds: 3600
  }
  </code></pre>
  
  <p>My question, then, is what the best RESTful approach should be for starting <code>LongOperationA</code>? </p>
  
  <p>The most obvious approach would seem to be making the operation itself the identifier, perhaps something along the lines of <code>POST <code>https://my-web-service.com/api/StartLongOperationA?DataID=xxxx</code></code>, but that seems a bit clunky, even if I don't specify the data identifier as a query parameter.</p>
  
  <p>It's also pretty trivial to implement this as an idempotent action, so using <code>POST</code> seems like a waste; on the other hand, <code>PUT</code> is awkward, since no data is actually being written to the service.</p>
  
  <p>Has anybody else faced this type of scenario in their services? What have you done to expose an API for initializing actions that honors RESTful principals?</p>
  
  <p>TIA,</p>
  
  <p>-Mark</p>