What are the most important HTTP status codes in REST APIs?

Answer

HTTP status codes communicate the outcome of a request. 200 OK: success for GET/PUT/PATCH. 201 Created: resource created (POST), with a Location header pointing to the new resource. 204 No Content: success with no response body (DELETE). 400 Bad Request: client sent invalid data (missing required field, wrong type). 401 Unauthorized: authentication is required or credentials are invalid. 403 Forbidden: authenticated but not authorized to perform the action. 404 Not Found: resource does not exist. 409 Conflict: state conflict (duplicate email on creation). 422 Unprocessable Entity: request format is valid but contains semantic errors (validation failures). 429 Too Many Requests: rate limit exceeded. 500 Internal Server Error: unexpected server failure. 503 Service Unavailable: server temporarily unavailable (maintenance or overload).