title: Best practice to batch update a collection in a REST Api call
body: <p>Hi I'm looking for best practices with API design to batch update a collection with an API call.</p>
  
  <p>My collection has URL /api/v1/cars and I would like to update all the cars in the collection to add a timestamp of the current time.</p>
  
  <pre><code>{
      data: [
      {
          manufacturer: 'Porsche',
          timestamp: ...
      },
      {
          manufacturer: 'BMW',
          timestamp: ...
      }
      {
          manufacturer: 'Peugeot',
          timestamp: ...
      }
  }
  </code></pre>
  
  <p>I thought about a few options but I can't figure what is the best practice.</p>
  
  <p>Should it be:</p>
  
  <p>1/ Modelled as another resource such as <code>POST api/v1/cars/updateTimestamp</code></p>
  
  <p>2/ Passed as a query parameter: <code>PUT api/v1/cars?updateTimestamp</code></p>
  
  <p>3/ Pass in the body of the request: </p>
  
  <pre><code>POST api/v1/cars 
  {"operation":"Update timestamps"}
  </code></pre>
  
  <p>I'd like to emphasize that the whole processing should be done on the back-end and not passed by the client.
  Same problem would happen for any complex processing that happens on the back end.. 
  How could I keep the API RESTy in this case.</p>
  
  <p>Thanks a lot for your help/any pointer to relevant ressources.</p>