WP Webhooks / Docs / fswa_webhook_response
Action since v1.9.0

fswa_webhook_response

Fires after every HTTP response is received — success or error — with full response context.

$

/ Signature

do_action( 'fswa_webhook_response', $webhook_id, $trigger, $response_code, $response_body, $payload, $webhook )

/ When it fires

Fires after every HTTP response, for both 2xx successes and error codes. Fires on the first synchronous attempt and on every queue retry.

/ Parameters

NameInTypeReqDescription
$webhook_idparamintyesWebhook configuration ID.
$triggerparamstringyesWordPress action name.
$response_codeparamintyesHTTP response status code.
$response_bodyparamstringyesRaw HTTP response body.
$payloadparamarrayyesThe final payload that was sent.
$webhookparamarrayyesFull webhook configuration row.

/ Examples

Store a returned HubSpot deal ID in post meta

add_action( 'fswa_webhook_response', function ( $webhook_id, $trigger, $code, $body, $payload, $webhook ) {
    if ( $code !== 201 ) return;
    $data = json_decode( $body, true );
    if ( isset( $data['id'], $payload['order_id'] ) ) {
        update_post_meta( (int) $payload['order_id'], '_hs_deal_id', sanitize_text_field( $data['id'] ) );
    }
}, 10, 6 );

/ Related

Ready

Stop losing webhooks.
Start logging them.

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