Skip to main content

benecaster_before_integration_action_run

Action Free

Fires when an outside system’s call to POST /wp-json/benecaster/v1/actions has passed every check — signed in, allowed to run integration actions, a registered action, the action’s add-on active on the show, valid fields and a usable idempotency key — immediately before the action’s handler runs. Actions are registered with benecaster_register_integration_action().

Not fired for a replay: a repeat of an earlier request with the same idempotency key returns the first answer and never reaches the handler.

Parameters

Name Type Default Description
$action string — The action name, `{addon-slug}.{noun}.{verb}`
$show_id int — The show the caller named
$data array — The validated data — declared fields only, already coerced to their declared types
$user_id int — The calling user (the integration user, or an administrator)

Examples

Time each integration action

add_action( 'benecaster_before_integration_action_run', function ( string $action, int $show_id, array $data, int $user_id ): void {
    $GLOBALS['my_action_started'] = microtime( true );
}, 10, 4 );

Notes

Benecaster already logs every call — who called what, and how it ended — on Settings → Webhooks → Incoming actions. Use this hook for anything beyond that; never log $data somewhere it outlives the call. Worked example: the recipe Let Zapier, Make or a CRM call your add-on.

Need this built rather than just documented? See our services →