Skip to main content
For written steps and a code example, go to Add error response handling.

Video transcript

Implementing error handling in your integration enables you to handle and determine the way your integration behaves when an error is returned by the API. There are times when your API could return an error status code, that is, a status code of 400 and above, in response to an API request sent by Zapier, but you do not want the integration to throw the error, or you want the integration to throw the error, but with a different and clearer error message. These are when error handling comes into use. Neglecting error handling can lead to unclear and inaccurate error messages or unnecessary workflow disruptions. There are two ways to implement error handling for an integration. You can either implement it for the entire integration or only for specific triggers and actions on the integration. To implement error handling for the entire integration, access the integration and navigate to the Advanced page under the Build section on the left side options. In the Advanced page, go to the Settings tab, and enable the skipThrowForStatus option. Doing this would ensure that whenever your API sends a response status code of 400 and above, the error would not be thrown in the integration, and instead, would be ignored. Click on the Save button to save this change. Doing that is not enough, because you would obviously want the integration to throw an error when there is actually a legitimate error from your API. You would then have to go to the API configuration of each trigger and action, switch them to Code Mode, then use JavaScript conditional statements to throw an error based on certain conditions in the API response. An example of how this can be done is this. Here, you can specify the error message, and when necessary, the error code to be shown to users in their Zaps. You can also set up the conditional statement to return a success (with a 200 status code) when certain conditions are met, even if the API response returned an error. It’s all up to you and how you intend the integration to act. To implement error handling for specific triggers and actions, you would have to ensure that skipThrowForStatus in the advanced settings page is disabled. On the individual triggers and actions on which you want to implement this, switch their API configuration to Code Mode. In the code, add a skipThrowForStatus property to the API request option, and give this property the value of true. By doing this, whenever your API sends a response status code of 400 and above for this specific trigger or action, the error would not be thrown in the integration, and instead, would be ignored. Other triggers and actions that do not have this property would throw an error automatically for every error status code returned in the API response. Similar to before, you would have to then add a JavaScript conditional statement in the return statement of the code to handle the errors based on the conditions provided. By implementing error handling, you ensure that users’ Zaps have little disruptions, and that when there are actual errors from the API request, the error messages are understandable to users, and in some cases, can enable users to self-serve and resolve the errors on their end.
Last modified on November 18, 2026