Errors as application/problem+json
Every API invents its own error shape and every client writes a parser for each. RFC 9457 already defined one.
{
"type": "https://example.com/errors/insufficient-funds",
"title": "Insufficient funds",
"status": 402,
"detail": "Balance is 12.50, the charge was 30.00.",
"instance": "/orders/8f2a"
}type is a stable identifier a client can switch on. detail is for a human. Extra fields are allowed.
httpapi-design