Set up your REST Hook trigger in the Platform UI with the Settings, Input Designer and API Configuration tabs.
bundle.targetUrl
, for each active Zap.expiration_date
property containing an ISO8601 date. The platform will automatically attempt to resubscribe after the expiration date.Hidden
if this trigger should not be shown to users.Hidden
is usually selected when the trigger is not ready to be used in the integration, or for polling triggers that power dynamic dropdown fields.
– Directions is used for static webhooks only to describe how and where to copy-paste the static webhook URL for the trigger within your app. Directions will not show to users in other cases. Static webhooks are not permitted in public integrations.
targetUrl
when making this request. You need to store the targetUrl, usually in a database, and you’d typically associate it with an id. Return that id in the response back to Zapier to be used later in the Unsubscribe.
Your app’s event system would determine which stored subscriptions should be invoked when an event occurs in your app, posting to the corresponding stored targetUrl
.
The webhook URL can be accessed via {{bundle.targetUrl}}
.
For example, for Gitlab’s API url
is used as the key for the {{bundle.targetUrl}}
value that contains the webhook URL to send data to.
bundle.subscribeData
.
bundle.subscribeData
.
return [bundle.cleanedRequest]
to return the data from the webhook as an array. If the data needs to be transformed, or includes multiple objects, you can add custom code to parse the response data in bundle.cleanedRequest
within the Perform into an array of objects.
If your webhook already provides an array, you can remove the wrapping array and simply return bundle.cleanedRequest
.
If, for architectural reasons, your webhook will receive some data that shouldn’t trigger the Zap, include code for the Perform function to return an empty array in those cases, so the Zap won’t run.
For data sent to Zapier via REST Hook, most requests will be successful and return a 200 status code with some request-tracking data. This indicates that Zapier has accepted the data, but it is still possible for errors to occur within the Zap if the structure of the provided data is unexpected.
DELETE <target_url>
, where target_url
is the unique target URL that was provided when the subscription was created. This will pause the Zap within Zapier.