title: REST pattern create, update and delete same endpoint
body: <p>I have a page where I list the books of a school. The user can update a book, add a new book or delete an existing book. All actions must be saved when the form is submitted.</p>
  
  <p>How can i map a rest API for that? I could take advantage of the endpoints i already have.</p>
  
  <p>UPDATE</p>
  
  <pre><code>PUT /schools/1/books
  {
    "books": [
      {
        "id": "1",
        "name": "Book 1"
      }
    ]
  }
  </code></pre>
  
  <p>CREATE</p>
  
  <pre><code>POST /schools/1/books
  {
    "books": [
      {
        "name": "Book 2"
      },
      {
        "name": "Book 3"
      }
    ]
  }
  </code></pre>
  
  <p>DELETE</p>
  
  <pre><code>DELETE /schools/1/books
  {
    "books": [
      {
        "id": 2
      }
    ]
  }
  </code></pre>
  
  <p>But I need everything to run on the same transaction, and wouldn't make sense to submit 3 requests.</p>
  
  <p>I also thought of creating a new endpoint where I would create books that doesn't exists, update books that exists, and remove books that are not present on the request.</p>
  
  <p>So if this school has <code>Book 1</code> and <code>Book 2</code>, I could update <code>Book 1</code>, create <code>New Book</code> and remove <code>Book 2</code> with:</p>
  
  <pre><code>PUT /schools/1/batch-books
  {
    "books": [
      {
        "id": "1",
        "name": "Updated Book 1"
      },
      {
        "name": "New Book"
      }
    ]
  }
  </code></pre>
  
  <p>Do you guys have other options?</p>