Skip to main content

REST API Status Codes

1xx Informational Responses

Status CodeNameDescription
100ContinueServer has received request headers, client should proceed with request body
101Switching ProtocolsServer is switching protocols as requested by client
102ProcessingServer has accepted request but processing is not complete
103Early HintsUsed to return some response headers before final HTTP message

2xx Success

Status CodeNameDescription
200OKRequest succeeded
201CreatedRequest succeeded and new resource was created
202AcceptedRequest accepted for processing but not completed
203Non-Authoritative InformationRequest successful but response from third party
204No ContentRequest successful but no content to return
205Reset ContentRequest successful, reset document view
206Partial ContentServer delivering only part of resource due to range header
207Multi-StatusMultiple status codes for multiple operations
208Already ReportedMembers already enumerated in previous reply
226IM UsedServer fulfilled GET request and response is instance-manipulations

3xx Redirection

Status CodeNameDescription
300Multiple ChoicesMultiple options for resource, client must choose
301Moved PermanentlyResource permanently moved to new URL
302FoundResource temporarily moved to different URL
303See OtherResponse found at different URL using GET
304Not ModifiedResource not modified since last request
305Use ProxyMust access resource through specified proxy
307Temporary RedirectResource temporarily at different URL, keep same method
308Permanent RedirectResource permanently at different URL, keep same method

4xx Client Errors

Status CodeNameDescription
400Bad RequestServer cannot process request due to client error
401UnauthorizedAuthentication required
402Payment RequiredPayment required (rarely used)
403ForbiddenServer understood request but refuses to authorize
404Not FoundRequested resource not found
405Method Not AllowedRequest method not supported for resource
406Not AcceptableResource not available in acceptable format
407Proxy Authentication RequiredClient must authenticate with proxy
408Request TimeoutServer timed out waiting for request
409ConflictRequest conflicts with current state of resource
410GoneResource no longer available and will not be available again
411Length RequiredServer requires Content-Length header
412Precondition FailedOne or more request preconditions failed
413Payload Too LargeRequest entity larger than server limits
414URI Too LongURI provided was too long
415Unsupported Media TypeMedia type not supported
416Range Not SatisfiableRange specified in Range header cannot be fulfilled
417Expectation FailedServer cannot meet requirements of Expect header
418I'm a teapotServer refuses to brew coffee because it's a teapot (April Fools' RFC)
421Misdirected RequestRequest directed at server unable to produce response
422Unprocessable EntityRequest well-formed but contains semantic errors
423LockedResource being accessed is locked
424Failed DependencyRequest failed due to failure of previous request
425Too EarlyServer unwilling to process request that might be replayed
426Upgrade RequiredClient should switch to different protocol
428Precondition RequiredServer requires request to be conditional
429Too Many RequestsUser has sent too many requests in given time
431Request Header Fields Too LargeRequest header fields too large
451Unavailable For Legal ReasonsUser agent requested resource that cannot legally be provided

5xx Server Errors

Status CodeNameDescription
500Internal Server ErrorGeneric server error
501Not ImplementedServer does not support functionality required
502Bad GatewayInvalid response from upstream server
503Service UnavailableServer currently unavailable
504Gateway TimeoutUpstream server failed to respond in time
505HTTP Version Not SupportedHTTP version not supported
506Variant Also NegotiatesTransparent content negotiation results in circular reference
507Insufficient StorageServer unable to store representation needed
508Loop DetectedServer detected infinite loop while processing request
510Not ExtendedFurther extensions to request required
511Network Authentication RequiredClient needs to authenticate to gain network access

Most Common Status Codes in REST APIs

Status CodeUsageWhen to Use
200GET successSuccessful retrieval of resource
201POST successSuccessful creation of new resource
204DELETE/PUT successSuccessful operation with no content to return
400Bad requestInvalid request syntax or parameters
401UnauthorizedMissing or invalid authentication
403ForbiddenValid request but access denied
404Not foundResource doesn't exist
409ConflictRequest conflicts with current state (e.g., duplicate creation)
422Validation errorRequest syntactically correct but semantically invalid
429Rate limitingToo many requests from client
500Server errorGeneric server-side error
503Service unavailableServer temporarily unavailable