JSON-RPC is a bit more concrete: https://www.jsonrpc.org/specification#error_object But again what you put into data is up to you.
Response structure might also depend on the client (content negotiation)