Filter since v2.4.0
fswa_export_doc
Attach top-level blocks to a Build export document before it is serialized.
$
/ Signature
apply_filters( 'fswa_export_doc', $doc, $webhook_ids, $chain_ids, $options )
/ When it fires
Fires once per export, after webhooks, chains, and credentials are collected and just before the JSON is returned. Pro uses it to bolt on an ai_build provenance block (the Build-with-AI transcript) when the exported objects trace back to an AI conversation and the user opted in. Anything you attach here is still subject to the two passes that run last: site-address anonymization, and personal-data redaction of captured values.
/ Parameters
| Name | In | Type | Req | Description |
|---|---|---|---|---|
| $doc | param | array | yes | The full export document (schema version, credentials, webhooks, chains). |
| $webhook_ids | param | int[] | yes | Webhook IDs included in this export. |
| $chain_ids | param | int[] | yes | Chain IDs included in this export. |
| $options | param | array | — | The caller's intent — `conversation_id`, `include_ai_transcript`, `anonymize_site_url`, `keep_captured_values`. Added in 2.5.0; three-argument callbacks keep working. |
/ Returns
array The export document, optionally with extra top-level blocks added./ Examples
Stamp exports with the source site URL
add_filter( 'fswa_export_doc', function ( $doc, $webhook_ids, $chain_ids, $options = array() ) { // Skip the stamp when the user asked for an anonymized build. if ( empty( $options['anonymize_site_url'] ) ) { $doc['exported_from'] = home_url(); } return $doc; }, 10, 4 );
/ Related
Ready Your next automation is
Your next automation is
one sentence away.
$ wp plugin install flowsystems-webhook-actions --activate