Passing errors with Identity trigged functions

In the docs for Functions/Identity webhooks, it says to return a 200 or 204 status code for the Identity process to succeed. When I send a non-200/204 status code, in the client I get an error message saying that the webhook has failed, but the error message provided by the webhook is not passed along. Is there a way to pass along error messages from the webhooks back to client?

I do not think so, but that is an interesting use case. Could you let us know what kinds of errors you are trying to distinguish between? Usually it’s “that failed, bring in a human” from our PoV so I don’t think we’ve thought about errors that might lead to different reactions…

Our use case is an eCommerce site that integrates with several other platforms like Salesforce. When customers sign up they include a phone number, and we need to check whether there is already an account associated with that phone number (GoTrue by itself will only confirm that there is existing email account so using webhooks seemed like natural way to extend GoTrue). We also have a list of banned phone numbers that allow us to prevent malicious users. Since we have more than one possibility from the server side as to why a user might have genuinely had their account rejected we need to be able to specify which result from the server to give users the proper response. That is why it would be helpful for us to pass errors from Identity Function webhooks back to client.

Thanks for all your help!

Hi Carl,

That’s a really good use case. I recommend filing a request in the Gotrue repo:

The webhooks are sent by gotrue so they need to be passed back from the gotrue server in response to the signup/login event from the client. This is something I’d like to see as well. I recommend that when you open the request you share the use-case that you provided here. Thanks!