API Design · Junior · Question 15 of 75

When should an API return 5xx codes?

Explanation

Clients and monitoring treat 4xx as client errors and 5xx as server errors. Returning 200 with an error body hides failures from both.

Further reading

Problem with a question

API Design · Junior · question 15

Test yourself

Take the API Design · Junior quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz