Skip to main content

Overview

The Webhook trigger runs an automation whenever an external service sends an HTTP POST request to a unique URL generated by AffZero. This makes it possible to kick off workflows from third-party platforms — trackers, CRMs, billing systems, or any service that supports outbound webhooks — in real time.

How it works

Each automation with a Webhook trigger gets a unique endpoint URL in the form:
https://app.affzero.com/api/webhooks/incoming/<token>
When this URL receives a POST request:
  1. AffZero verifies the request (optionally checking a secret)
  2. The automation starts executing immediately
  3. Any JSON fields from the request body become variables in subsequent steps

Webhook variables

When the trigger fires, all top-level fields from the incoming JSON body are available as variables in the automation:
// Incoming request body
{
  "campaign_id": "abc123",
  "event": "conversion",
  "revenue": "42.50"
}
The above body produces:
  • {webhook_campaign_id}abc123
  • {webhook_event}conversion
  • {webhook_revenue}42.50
All webhook variables are prefixed with webhook_ to avoid naming conflicts with other step variables.

Secret verification

Each webhook trigger can have an optional secret token. When set, AffZero checks that incoming requests include the correct secret in the X-AffZero-Secret header. Requests without the correct secret are rejected with a 401 response. You can find (and rotate) the secret for a webhook trigger in the trigger settings inside the automation builder.

Use cases

  • Run a stats pull + email as soon as a CRM flags a new high-value affiliate
  • Trigger an invoice workflow when a payment is confirmed in a billing platform
  • Kick off a data analysis when a conversion milestone is reached in your tracker
  • Start a multi-step approval workflow from an external event

Tips

Use the Send Webhook step when you want AffZero to send data to an external service. The Webhook trigger is for when an external service sends data to AffZero.
AffZero only processes POST requests to webhook trigger URLs. Requests with other methods are ignored.