Look up a Rails HTTP Status Code

401 - Unauthorized

Rails HTTP Status code :unauthorized

When to use status code 401

Similar to 403 Forbidden, but specifically for use when authentication is required and has failed or has not yet been provided. The response must include a WWW-Authenticate header field containing a challenge applicable to the requested resource. 401 semantically means "unauthenticated", i.e. "you don't have necessary credentials".