Learn

HTTP Status Codes Guide

About this tool

A searchable reference of HTTP response status codes, what each one means and when a server should return it.

Questions

When should I return 401 instead of 403?
401 means the request lacks valid authentication credentials for the resource; a client may need to authenticate or renew them. 403 means the server understood the request but refuses it. Do not assume a 403 always means the client was successfully authenticated; check your application’s access rules.
Does 200 always mean success?
For a GET, usually. For an API, a 200 carrying an error object is a common and unhelpful habit. Prefer a status code that matches the outcome.