Success Codes
- GET - 200 OK
- POST
- 200 OK when an object is created and returned
- 201 CREATED when an object is created but only its reference is returned (such as an ID or a link)
- PUT/PATCH/DELETE
- 200 OK when an object is updated and returned
- 204 NO CONTENT when there is no content to send for this request, but the headers may be useful.
Client Error Codes
- 400 BAD REQUEST - invalid syntax of request entity - body is missing mandatory parameters, input is outside valid domain (like "abc" is sent for a field that expects integers). It's the generic client-side error status, used when no other 4xx error code is appropriate. Errors can be like malformed request syntax, invalid request message parameters, or deceptive request routing etc.
- 401 UNAUTHORIZED - client needs to authenticate itself.
- 403 FORBIDDEN - client's identity is known to server, but doesn't have rights to content
- 404 NOT FOUND - server is not able to find requested resource, endpoint is valid but resource doesn't exist, or badly constructed URI (path is incorrect)
- 405 METHOD NOT ALLOWED - request method is known by the server but has been disabled and cannot be used
- 409 CONFLICT - when a request conflicts with the current state of the server
- 413 PAYLOAD TOO LARGE - request entity is larger than limits defined by server
- 414 URI TOO LONG - URI requested by the client is longer than the server is willing to interpret
- 429 TOO MANY REQUESTS - user has sent too many requests in a given amount of time ("rate limiting")
- 422 Unprocessable Entity - server understands the content type of the request entity (hence a 415(Unsupported Media Type) status code is inappropriate), and the syntax of the request entity is correct (thus a 400 (Bad Request) status code is inappropriate) but was unable to process the contained instructions, may be due to business rules.
Server Error Codes
- 500 INTERNAL SERVER ERROR - server has encountered a situation it doesn't know how to handle
- 501 NOT IMPLEMENTED - request method is not supported by the server and cannot be handled