When creating a resource, ideally you'd have some mechanism in place to dynamically generate the unique references(ID, etc).
If, however, you're creating user accounts bound to a user id or email, you may run into a scenario like the one you've mentioned. In that case, the 409 seems more appropriate if you want to avoid the generic 400. I wouldn't use 406.
When creating a resource, ideally you'd have some mechanism in place to dynamically generate the unique references(ID, etc).
If, however, you're creating user accounts bound to a user id or email, you may run into a scenario like the one you've mentioned. In that case, the 409 seems more appropriate if you want to avoid the generic 400. I wouldn't use 406.
This is what I would expect, but Coreys reply makes sense too. I wonder if there is some specification for this, or what the general consensus is.
I've worked with a few REST APIs and most haven't been consistent in this regard.