Error Responsesbeginner

Unauthorized Error JSON Example

A 401-style error payload that explains the auth problem without leaking sensitive detail.

Real-world use case: Use this for protected APIs, auth docs, and middleware examples.
1{
2 "error": {
3 "code": "UNAUTHORIZED",
4 "message": "Authentication credentials were missing or invalid.",
5 "hint": "Send a valid Bearer token in the Authorization header."
6 }
7}

Where this shape shows up in production

Protected APIs
Developer portals
Auth middleware

Related examples