API Design · Middle · Question 12 of 75

Should an API return 403 or 404 when a user requests another user's private resource?

Explanation

Either way, the server must check ownership on every request; status codes don't replace authorization.

Further reading

Problem with a question

API Design · Middle · question 12

Test yourself

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

Take this quiz