WP Webhooks / Docs / assign_snippet
AI Ability Pro since v1.3.0

assign_snippet

Assign a Code Glue snippet to a webhook — Attach a snippet to a webhook+trigger as its pre-dispatch (payload transform) or post-dispatch (after-response side effects) Code Glue and enable it.

$

Attach a snippet to a webhook+trigger as its pre-dispatch (payload transform) or post-dispatch (after-response side effects) Code Glue and enable it. Requires confirmation — the snippet's PHP runs on every real dispatch from then on. Pass snippet_id 0 to unassign, or enabled false to keep it assigned but paused. Registered as the WordPress Ability flowsystems-webhook-actions/assign_snippet, so external AI tools (Claude Code, Cursor) can call it over MCP or REST with a scoped API token.

/ Plan step shape

{ "ability": "assign_snippet", "input": { "webhook_id":, "trigger":, "stage":, "snippet_id":, "enabled":} }

/ Scope & confirmation

Minimum API-token scope for external (MCP/REST) callers: full. This step always pauses for explicit user confirmation before it runs.

/ Input fields

NameInTypeReqDescription
webhook_idparamintegeryes
triggerparamstringyes
stageparamstringyespre = transform payload before dispatch; post = run after the response. pre | post
snippet_idparamintegeryes0 to unassign.
enabledparamboolean

/ Examples

Plan step as the AI Builder proposes it

{
  "id": "step_1",
  "ability": "assign_snippet",
  "summary": "…",
  "input": {
    "webhook_id": 12,
    "trigger": "woocommerce_order_status_completed",
    "stage": "pre",
    "snippet_id": 4,
    "enabled": true
  }
}

/ Related

Ready

Your next automation is
one sentence away.

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