Json response from an external API

I developed an API to integrate with the application example, it is querying the data, the problem is that I don’t know how to return error codes 400, 500 when I send a POST to it because it seeks a user for making a it refunds an error in the app. Can you tell me if there is any specific information that I have to return via Json to display the error in Appygyver?