Configure API response error messages

Hi,
How I can modify the response error message that are generated in apigateway lambda integration?
The format is not very standard and I would like to have error responses using this format:
{
“errors”: [
{
“category”: “AUTHENTICATION_ERROR”,
“code”: “UNAUTHORIZED”,
“detail”: “This request could not be authorized.”
}
]
}
Thank you advance

1 Like

This might help https://kennbrodhagen.net/2016/03/09/how-to-return-a-custom-error-object-and-status-code-from-api-gateway-with-lambda/. It’s been a while since I watched it but I seem to remember he had a solution.