WP Webhooks / Docs / fswa_webhook_saved
Action since v1.3.0

fswa_webhook_saved

Fires after a webhook is created or updated via the REST API.

$

/ Signature

do_action( 'fswa_webhook_saved', $webhook_id, $webhook_data, $is_new )

/ When it fires

Fires after the webhook row is written to the database, inside the REST API handler for create and update operations. Extensions use this to persist their own per-webhook fields.

/ Parameters

NameInTypeReqDescription
$webhook_idparamintyesWebhook configuration ID.
$webhook_dataparamarrayyesThe saved webhook data array.
$is_newparamboolyes`true` if the webhook was just created; `false` on update.

/ Examples

Log webhook changes to an audit log

add_action( 'fswa_webhook_saved', function ( $webhook_id, $webhook_data, $is_new ) {
    $action = $is_new ? 'created' : 'updated';
    $name   = $webhook_data['name'] ?? "#{$webhook_id}";
    error_log( "[fswa] Webhook {$name} {$action} (ID: {$webhook_id})" );
}, 10, 3 );

/ Related

Ready

Your next automation is
one sentence away.

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