title: JSON response for REST API post for collections
body: <p>I have found very little detail about best practices when responding to PUT or POST commands with a REST API. </p>
  
  <p>Assume the example is that the API is for a list of movies in a movie store and has the following:</p>
  
  <ul>
  <li>GET api/Movies</li>
  <li>GET api/Movies/{id} </li>
  <li>PUT api/Movies/ </li>
  <li>PUT api/Movies/{id} </li>
  <li>POST api/Movies/ </li>
  <li>POST api/Movies/{id}</li>
  </ul>
  
  <p>Where you can PUT or POST either single or collections. I included both because I do not want to get into a discussion about PUT vs. POST, and would like an answer on best practices, particularly in response to errors.</p>
  
  <p>If working on a single item I can return HTTP status codes and a response easily, but what should be done when handling POST and PUT of collections, especially in a non-idempotent method?</p>
  
  <p>My thought for returning a package would be as follows:</p>
  
  <pre><code>{
     "version": "1.0"
     "status": 200,
     "errors": [
        // List of object id's, and errors
     ]
     "data": [
        // List of movies POSTed or PUT
     ]
  }
  </code></pre>
  
  <p>With the errors being generated for each specific ID that failed, but I'm not sure it passes the smell test in regards to overall status and HttpStatus. Should I return another status if a portion of the collection fails or a single entity fails?</p>