title: Fine grained vs coarse grained REST API
body: <p>I am working on a REST API for managing users. Each user has a name and a surname and a list of his own contacts (name, type, value). I am considering two approaches to modelling the REST API, the coarse grained approach:</p>
  
  <ul>
  <li>GET /user/{id}, to get the user details along with his contacts</li>
  <li>POST /users, to add a new user along with his contacts</li>
  <li>PUT /users/{id}, to update a user along with his contacts</li>
  </ul>
  
  <p>or the fine grained approach:</p>
  
  <ul>
  <li>GET /user/{id}, to get the user details</li>
  <li>GET /user/{id}/contacts, to get the user's contacts</li>
  <li>POST /user, to add a new user</li>
  <li>PUT /user/{id}, to update a user</li>
  <li>POST /user/{id}/contacts, to add a new user contact</li>
  <li>PUT /user/{id}/contact/{id}, to update a user contact</li>
  <li>DELETE /user/{id}/contact/{id}, to delete a user contact</li>
  </ul>
  
  <p>When the fine grained approach should be choosen over the coarse grained approach?</p>