I've been abusing HTTP Status Codes in my APIs for years
I think the article is missing some points with regards to the REST.<p>If the API that the author is building is a REST API then the response for a non-existing resource is 404.<p>In case of REST the main idea is that if you try to GET a resource by ID then you assume that the resource exists. Thus if it does not exists =&gt; 404.<p>It does not matter too much which part of the URL is the one that is causing the URL to be wrong.<p>Thus `api&#x2F;v11&#x2F;employees&#x2F;1` and `&#x2F;api&#x2F;v1&#x2F;employees&#x2F;100` both are wrong resources.<p>In the first case, asking for `&#x2F;api&#x2F;v11&#x2F;employees&#x2F;1` is not a search or find to see if there is a V11 and if inside there is employee 1. Building an URL is an intentional choise that includes assumptions, like there is an &#x27;api&#x27;, that has a &#x27;v11&#x27; and inside there are employees and one should have the ID 1.<p>The same goes for later case with employee ID 100. If you ask for an employee with an ID that means you know (or assume that you know) that employee exists. Thus if it does not it should be very level clear =&gt; 404.<p>In both cases responding with 200 means something like &quot;I kind understand that you want an URL that is similar with some that I have so it is almost okish&quot;.<p>But in REST this is not the case. It is like you are serving some static folders and you want to get the file 100 under &#x2F;api&#x2F;v1&#x2F;employee and that file does not exists.<p>Nobody is stoppping anyone to add response body to a 404 to indicate which nested resource is invalid. That can be added as a debug message for the developer for example.<p>Of course this is IMHO and I am only addressing REST API. If the API is not supposed to be REST then do whatever you want but make sure you document it well and be consistent.