Skip to content

Common HTTP Status Codes and When to Implement Them in API or HTTP Response

Status CodeMeaningWhen to Implement
200 OKThe request has succeededImplement when the request was successful
201 CreatedThe request has been fulfilled and a new resource has been createdImplement when a new resource has been successfully created
204 No ContentThe server has successfully fulfilled the request, but there is no additional content to send in the responseImplement when the request was successful, but there is no content to return
400 Bad RequestThe server cannot or will not process the request due to a client errorImplement when there is a problem with the request data, such as missing or invalid parameters
401 UnauthorizedThe client must authenticate itself to get the requested responseImplement when the user is not authenticated or the authentication token is invalid
403 ForbiddenThe client does not have access rights to the content, so the server is refusing to give the requested responseImplement when the user is authenticated, but does not have permission to access the requested resource
404 Not FoundThe server cannot find the requested resourceImplement when the requested resource does not exist
500 Internal Server ErrorA generic error message, given when an unexpected condition was encountered and no more specific message is suitableImplement when there is an unexpected error on the server