API urls: Implicit vs Explicit tenant ids
<p>Within a multi tenant app, I have two choices to expose my resources:</p>

<pre><code>  api.myapp.com/customer/{id}
  api.mayap.com/{tenant}/customer/{id}
</code></pre>

<p>I am wondering about the pros and cons of exposing the tenant name. In the first case the tenant name is given as a header field, and in the second directly within the URL.</p>

<p>On one hand I do want to have the cleanest and simplest possible URL structure. Since all resource IDs will be UUIDs, having the tenant namespace seems redundant.</p>

<p>On the other I am not sure if having the tenant name exposed in the URLs will make caching easier or any other factor I have not yet considered (monitoring, integration with third party services, etc)</p>

<p><strong>Which are the downsides of removing the tenant namespace from an API?</strong></p>

<p><strong>Which are the factors I should consider while making this choice?</strong></p>