Process Model Error reporting via API

We have an  POST API on Appian that is being called to perform user related task ( add, remove, update, activate, deactivate) based on the data sent to the API. The API works fine as its a Cast and the API response of the Cast is being being sent back to the API initiator. However when there is an error the response is sent as an email alert how can the error be sent as an api response. For eg 

There is a problem with task “Deactivate User” in the process “PPL_IG Deactivate User Profile”

Problem:  An error occurred in executing an Activity Class.

Details:  The user [test.abc] you are trying to deactivate is invalid or does not exist.

Recommended Action:  Examine the activity class to correct the error and then resume.

How do i capture the "Details:  The user [test.abc] you are trying to deactivate is invalid or does not exist." from the error message received via email? 

Parents Reply Children

 Discussion posts and replies are publicly visible