One of the important elements in building a good REST api, is the correct usage of the HTTP Status Codes.
A help in identifying the correct status code to return is the following ’http decision diagram’.
This diagram describes the resolution of HTTP response status codes, given various headers. It follows the indications in RFC7230 RFC7231 RFC7232 RFC7233 RFC7234 RFC7235, and fills in the void where necessary.
You can find this diagram here: https://github.com/for-GET/http-decision-diagram