title: Exclusive endpoint for authenticated user in a Rest API using JWT
body: <p>I'm starting with the design of a Rest API for a bookings app. I've developed some Rest API's in the past but this is the first time I design it alone. I'm using user authentication trough JWT.</p>
  
  <p>So, imagine that I want to retrieve the preferences for an authenticated user. What is the most 'Rest' option?</p>
  
  <ol>
  <li><p><code>/users/:userId/preferences</code> and send the JWT in the <code>Authorization</code> header to check if the userId is the same as the authenticated user.</p></li>
  <li><p><code>/me/preferences</code> and only send the JWT to get the preferences of the authenticated user.</p></li>
  </ol>
  
  <p>The first option seems the most 'Rest' one because of the resource oriented endpoint, but you need to store the userId in the client and then send it to the API with the JWT. Looks like a bit repetitive right?</p>
  
  <p>I have seen that big API's like PayPal uses the second option and others like AirBnB uses the first one hashing the userId.</p>
  
  <p>Which option is better and why? I'm very doubtful with this... Thanks.</p>