WP Webhooks / Docs / fswa_webhook_url
Filter since v1.0.0

fswa_webhook_url

Rewrites the webhook endpoint URL per-event before dispatch.

$

/ Signature

apply_filters( 'fswa_webhook_url', $url, $payload, $webhook, $trigger, $original_payload )

/ When it fires

Fires after Pro URL template expansion (`{{ field }}` tokens), just before the HTTP request is built.

/ Parameters

NameInTypeReqDescription
$urlparamstringyesThe configured endpoint URL (may already contain expanded Pro templates).
$payloadparamarrayyesThe final outgoing payload (post-mapping, post-Code Glue).
$webhookparamarrayyesFull webhook configuration row.
$triggerparamstringyesWordPress action name.
$original_payloadparamarray|nullPre-mapping payload as fallback for token resolution.

/ Returns

string The URL to use for this delivery. Must be a valid HTTPS URL (unless `fswa_require_https` is false).

/ Examples

Inject a record ID from payload into the URL path

add_filter( 'fswa_webhook_url', function ( $url, $payload, $webhook, $trigger, $original ) {
    if ( (int) $webhook['id'] !== 30 ) return $url;
    $deal_id = $payload['_hs_deal_id'] ?? '';
    return "https://api.hubapi.com/crm/v3/objects/deals/{$deal_id}";
}, 10, 5 );

/ Related

Ready

Stop losing webhooks.
Start logging them.

$ wp plugin install flowsystems-webhook-actions --activate