---
title: "update_snippet — AI Ability"
description: "Update a Code Glue snippet — Update an existing Code Glue snippet's name, code or tags."
url: "https://wpwebhooks.org/docs/ability-update-snippet/"
---

[WP Webhooks](/) / [Docs](/docs/) / update\_snippet

AI Ability Pro since v1.3.0

# update\_snippet

Update a Code Glue snippet — Update an existing Code Glue snippet's name, code or tags.

Update an existing Code Glue snippet's name, code or tags. If the snippet is already assigned and enabled on a webhook, the new code runs on the next dispatch — re-test with preview\_snippet after editing. Registered as the WordPress Ability `flowsystems-webhook-actions/update_snippet`, so external AI tools (Claude Code, Cursor) can call it over MCP or REST with a scoped API token.

/ Plan step shape

```
{ "ability": "update_snippet", "input": { "id": …, "name": …, "code": …, "tags": … } }
```

/ Scope & confirmation

Minimum API-token scope for external (MCP/REST) callers: `full`. Runs without a confirmation pause (the overall plan is still user-approved before execution starts).

/ Input fields

| Name | In | Type | Req | Description |
| --- | --- | --- | --- | --- |
| id | param | integer | yes |  |
| name | param | string | — |  |
| code | param | string | — |  |
| tags | param | array | — |  |

/ Examples

Plan step as the AI Builder proposes it

```
{
  "id": "step_1",
  "ability": "update_snippet",
  "summary": "…",
  "input": {
    "id": 4,
    "code": "$payload[\"tag\"] = {{ $args.0.total }} > 250 ? \"vip\" : \"standard\";\nreturn $payload;"
  }
}
```

/ Related

[preview\_snippet](/docs/ability-preview-snippet/)[get\_snippet](/docs/ability-get-snippet/)[REST API reference](/webhook-wordpress-plugin-api/)

/Ready

## Your next automation is  
one sentence away.

[Install Plugin→](https://wordpress.org/plugins/flowsystems-webhook-actions/) [See the Plugin →](/wordpress-webhook-plugin/)

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

## Structured data

```json
{"@context":"https://schema.org","@type":"TechArticle","name":"update_snippet — AI Ability — Webhook Actions Docs","description":"Update a Code Glue snippet — Update an existing Code Glue snippet's name, code or tags.","url":"https://wpwebhooks.org/docs/ability-update-snippet/","isPartOf":{"@type":"WebSite","name":"WP Webhooks","url":"https://wpwebhooks.org"},"about":{"@type":"SoftwareApplication","name":"Webhook Actions","applicationCategory":"WordPress Plugin"}}
```
