When building a RESTful API and a user provides an id of resource that does not exist, should you return 404 Not Found or 400 Bad Request
According to the RFC (https://tools.ietf.org/html/rfc2616#section-10.4) the API should return 404 when
"The server has not found anything matching the Request-URI",
which is your example.
400 would be when the resource is found, but the request itself is malformed.
For instance: i. https://api.domain.com/v1/resource/foobar
where foobar DOES NOT exist should return 404
ii.
https://api.domain.com/v1/resource/foobar
where foobar DOES exist, but the request is wrong ({age:"NOTANINTEGER"}, a string instead of an int for example), it should return 400.
Hope I could help.