Hi,
Super easy, but it would be lots easier if you had shared your flow since you asked how to pass data back but didnt share so here is the answer
1. In your flow you need to add a Try / Catch Scope set, so that you can catch the error
2. Add a Variable to capture Status and StatusCode, default Status as a String to "Successful", Set StatusCode as an Integer and set it to 200. This way they are defaulted to it worked
3. In your Catch Scope action, set the StatusCode to "502" or 500 doesn't really matter unless you want the EXACT code from the API in which case you need to grab that from the HTTP Call Response to the API and then Set the StatusCode variable to whatever you pull out.
Set the Status to either "Failed" or whatever message you get back from the API call
4. Add a Respond to Power Apps Action at the end of your flow. Make sure you set the Catch RunAfter Settings to only Timed Out, Failed/Error, Skipped and set the RunAfter for the Response to Power Apps / Child Flow Action to all 4, Success, Failed/Error, skipped, Timed Out
Pass back the Status and StatusCode values
In your Canvas app when you call your flow do it like this
Set(responseStatus, MyFlow.Run());
Now you call check responseStatus.Status to see the words or responseStatus.StatusCode to get the number and see if it failed or not.