HTTP Status Codes for Rest API

HTTP Status Codes

The HTTPS Status codes are the 3-digit integer response from the server where the first digit indicates the class of response.

1xx: Informational 

Communicates transfer protocol-level information.

STATUSMEANINGDESCRIPTION
400Bad RequestThe request could not be understood by the server due to incorrect syntax. The client SHOULD NOT repeat the request without modifications.
401UnauthorizedIndicates that the request requires user authentication information. The client MAY repeat the request with a suitable Authorization header field
402Payment RequiredReserved for future use. It is aimed at the use of digital payment systems.
403ForbiddenUnauthorized request. The client does not have access rights to the content. Unlike 401, the client’s identity is known to the server.
404Not FoundThe server cannot find the requested resource.
405Method Not AllowedThe request HTTP method is known by the server but has been disabled and cannot be used for that resource.
406Not AcceptableThe server doesn’t find any content that conforms to the criteria given by the user agent in the Accept header sent in the request.
412Precondition FailedThe client has indicated preconditions in its headers that the server does not meet.
413Request Entity Too LargeThe request entity is larger than the limits defined by the server.

2xx: Success 

Indicates that the client’s request was accepted successfully.

STATUSMEANINGDESCRIPTION
200OKIndicates that the request has succeeded.
201CreatedIndicates that the request has succeeded and a new resource has been created as a result.
202AcceptedIndicates that the request has been received but not completed yet. It is typically used in log running requests and batch processing.
203Non-Authoritative InformationIndicates that the returned meta information in the entity header is not the definitive set as available from the origin server, but is gathered from a local or a third-party copy. The set presented MAY be a subset or superset of the original version.
204No ContentThe server has fulfilled the request but does not need to return a response body. The server may return the updated meta information.
205Reset ContentIndicates the client to reset the document which sent this request.
206Partial ContentIt is used when the Range header is sent from the client to request only part of a resource.
207Multi-Status (WebDAV)An indicator to a client that multiple operations happened, and that the status for each operation can be found in the body of the response.
208Already Reported (WebDAV)Allows a client to tell the server that the same resource (with the same binding) was mentioned earlier. It never appears as a true HTTP response code in the status line, and only appears in bodies.
226IM UsedThe server has fulfilled a GET request for the resource, and the response is a representation of the result of one or more instance manipulations applied to the current instance.


3xx: Redirection 

Indicates that the client must take some additional action in order to complete their request.

STATUSMEANINGDESCRIPTION
300Multiple ChoicesThe request has more than one possible response. The user-agent or user should choose one of them.
301Moved PermanentlyThe URL of the requested resource has been changed permanently. The new URL is given by the Location header field in the response. This response is cacheable unless indicated otherwise.
302FoundThe URL of the requested resource has been changed temporarily. The new URL is given by the Location field in the response. This response is only cacheable if indicated by a Cache-Control or Expires header field.
303See OtherThe response can be found under a different URI and SHOULD be retrieved using a GET method on that resource.
304Not ModifiedIndicates to the client that the response has not been modified, so the client can continue to use the same cached version of the response.
305Use ProxyIndicates that a requested response must be accessed by a proxy.
306Switch ProxyIt is a reserved status code and is not used anymore.
307Temporary RedirectIndicates the client to get the requested resource at another URI with the same method that was used in the prior request.
308Permanent RedirectIndicates that the resource is now permanently located at another URI, specified by the Location header. 


4xx: Client Error 

This category of error status codes indicates the error at the client.

STATUSMEANINGDESCRIPTION
400Bad RequestThe request could not be understood by the server due to incorrect syntax. The client SHOULD NOT repeat the request without modifications.
401UnauthorizedIndicates that the request requires user authentication information. The client MAY repeat the request with a suitable Authorization header field
402Payment RequiredReserved for future use. It is aimed at the use of digital payment systems.
403ForbiddenUnauthorized request. The client does not have access rights to the content. Unlike 401, the client’s identity is known to the server.
404Not FoundThe server cannot find the requested resource.
405Method Not AllowedThe request HTTP method is known by the server but has been disabled and cannot be used for that resource.
406Not AcceptableThe server doesn’t find any content that conforms to the criteria given by the user agent in the Accept header sent in the request.
412Precondition FailedThe client has indicated preconditions in its headers that the server does not meet.
413Request Entity Too LargeThe request entity is larger than the limits defined by the server.


5xx: Server Error 

The server takes responsibility for these error status codes.

STATUSMEANINGDESCRIPTION
500Internal Server ErrorThe server encountered an unexpected condition that prevented it from fulfilling the request.
501Not ImplementedThe HTTP method is not supported by the server and cannot be handled.
502Bad GatewayThe server got an invalid response while working as a gateway to get the response needed to handle the request.
503Service UnavailableThe server is not ready to handle the request.
504Gateway TimeoutThe server is acting as a gateway and cannot get a response in time for a request.
505HTTP Version Not SupportedThe HTTP version used in the request is not supported by the server.
511Network Authentication RequiredIndicates that the client needs to authenticate to gain network access.