> ## Documentation Index
> Fetch the complete documentation index at: https://veryfront.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Update webhook

> Change the name, target, prompt template, event filter or status of a webhook, for example to enable or disable deliveries; returns the updated webhook.

export const McpToolCall = ({tool, initialArguments = {}, requiresConfirmation = false}) => {
  const validateCall = function validateReferenceToolCall(token, text, requiresConfirmation, confirmed) {
    if (!token.trim()) return {
      error: "Paste a bearer token first."
    };
    let value;
    try {
      value = JSON.parse(text.trim() || "{}");
    } catch {
      return {
        error: "Arguments must be valid JSON."
      };
    }
    if (!value || typeof value !== "object" || Array.isArray(value)) return {
      error: "Arguments must be a JSON object."
    };
    if (requiresConfirmation && !confirmed) return {
      error: "Confirm the tool call before running it."
    };
    return {
      arguments: value
    };
  };
  const endpoint = "https://api.veryfront.com/mcp";
  const tokenStorageKey = 'veryfront.docs.mcpBearerToken';
  const escapeHtml = value => value.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;');
  const highlightJson = value => {
    const escaped = escapeHtml(value);
    return escaped.replace(/("(?:\\u[a-fA-F0-9]{4}|\\[^u]|[^\\"])*"(\s*:)?|\btrue\b|\bfalse\b|\bnull\b|-?\d+(?:\.\d+)?(?:[eE][+\-]?\d+)?)/g, match => {
      let color = '#f3f4f6';
      if (match.endsWith(':')) {
        color = '#7dd3fc';
      } else if (match.startsWith('"')) {
        color = '#86efac';
      } else if ((/true|false/).test(match)) {
        color = '#c4b5fd';
      } else if ((/null/).test(match)) {
        color = '#fcd34d';
      } else {
        color = '#67e8f9';
      }
      return `<span style="color: ${color}">${match}</span>`;
    });
  };
  const expandJsonStrings = value => {
    if (typeof value === 'string') {
      const trimmed = value.trim();
      if (trimmed.startsWith('{') && trimmed.endsWith('}') || trimmed.startsWith('[') && trimmed.endsWith(']')) {
        try {
          return expandJsonStrings(JSON.parse(trimmed));
        } catch {}
      }
      return value;
    }
    if (Array.isArray(value)) {
      return value.map(expandJsonStrings);
    }
    if (value && typeof value === 'object') {
      return Object.fromEntries(Object.entries(value).map(([key, nestedValue]) => [key, expandJsonStrings(nestedValue)]));
    }
    return value;
  };
  const formatJson = value => {
    try {
      return JSON.stringify(expandJsonStrings(value), null, 2);
    } catch {
      return String(value);
    }
  };
  const formatResponseText = text => {
    const trimmed = text.trim();
    if (!trimmed) return 'No response body.';
    try {
      return formatJson(JSON.parse(trimmed));
    } catch {}
    const ssePayloads = trimmed.split(/\n\n+/).flatMap(chunk => chunk.split('\n').filter(line => line.startsWith('data:')).map(line => line.slice(5).trim()).filter(Boolean));
    for (let index = ssePayloads.length - 1; index >= 0; index -= 1) {
      try {
        return formatJson(JSON.parse(ssePayloads[index]));
      } catch {}
    }
    return trimmed;
  };
  const readStoredToken = () => {
    if (typeof window === 'undefined') return '';
    try {
      return window.sessionStorage.getItem(tokenStorageKey) || '';
    } catch {
      return '';
    }
  };
  const writeStoredToken = value => {
    if (typeof window === 'undefined') return;
    try {
      if (value) {
        window.sessionStorage.setItem(tokenStorageKey, value);
      } else {
        window.sessionStorage.removeItem(tokenStorageKey);
      }
    } catch {}
  };
  const [token, setToken] = useState(readStoredToken);
  const [argumentText, setArgumentText] = useState(formatJson(initialArguments));
  const [status, setStatus] = useState('Ready');
  const [response, setResponse] = useState('No response yet.');
  const [copied, setCopied] = useState(false);
  const [confirmed, setConfirmed] = useState(false);
  const callTool = async () => {
    const validation = validateCall(token, argumentText, requiresConfirmation, confirmed);
    if (('error' in validation)) {
      setStatus(validation.error);
      return;
    }
    const parsedArguments = validation.arguments;
    setConfirmed(false);
    const body = {
      jsonrpc: '2.0',
      id: Date.now(),
      method: 'tools/call',
      params: {
        name: tool,
        arguments: parsedArguments
      }
    };
    setStatus('Calling tool...');
    setResponse(formatJson(body));
    try {
      const result = await fetch(endpoint, {
        method: 'POST',
        headers: {
          accept: 'application/json, text/event-stream',
          'content-type': 'application/json',
          authorization: `Bearer ${token.trim()}`,
          'x-veryfront-origin': 'docs-mcp-tool-page'
        },
        body: JSON.stringify(body)
      });
      const text = await result.text();
      setStatus(result.ok ? 'Response received.' : `Request failed with HTTP ${result.status}.`);
      setResponse(formatResponseText(text));
    } catch (error) {
      setStatus('Request failed.');
      setResponse(error instanceof Error ? error.message : String(error));
    }
  };
  const copyResponse = async () => {
    try {
      await navigator.clipboard.writeText(response);
      setCopied(true);
      setTimeout(() => setCopied(false), 1500);
    } catch {
      setStatus('Copy failed.');
    }
  };
  return <details className="api-try-operation not-prose">
    <summary>Try this tool</summary>
    <p>Replace sample arguments with values for your project or connected account. Calls run only when you select Run tool.</p>
    <div className="api-request-playground not-prose my-6 rounded-xl border border-gray-200 bg-white p-4 dark:border-gray-800 dark:bg-gray-950">
      <div className="mb-4">
        <div className="text-sm font-semibold text-gray-900 dark:text-gray-100">MCP tool call</div>
        <div className="mt-1 text-sm text-gray-600 dark:text-gray-400">
          Call <code>{tool}</code> against the Veryfront MCP endpoint.
        </div>
      </div>

      <label className="mb-2 block text-sm font-medium text-gray-900 dark:text-gray-100" htmlFor={`${tool}-token`}>
        Bearer token or API key
      </label>
      <input id={`${tool}-token`} className="mb-4 w-full rounded-md border border-gray-300 bg-white px-3 py-2 text-sm text-gray-900 dark:border-gray-700 dark:bg-gray-900 dark:text-gray-100" type="password" value={token} onChange={event => {
    const value = event.target.value;
    setToken(value);
    setConfirmed(false);
    writeStoredToken(value);
  }} placeholder="Paste API key or JWT" />

      <label className="mb-2 block text-sm font-medium text-gray-900 dark:text-gray-100" htmlFor={`${tool}-arguments`}>
        Arguments (JSON)
      </label>
      <textarea id={`${tool}-arguments`} className="mb-4 min-h-40 w-full rounded-md border border-gray-300 bg-white px-3 py-2 font-mono text-sm text-gray-900 dark:border-gray-700 dark:bg-gray-900 dark:text-gray-100" value={argumentText} onChange={event => {
    setArgumentText(event.target.value);
    setConfirmed(false);
  }} spellCheck={false} />

      {requiresConfirmation && <label className="api-request-confirmation mb-4 flex items-start gap-2 text-sm">
        <input type="checkbox" checked={confirmed} onChange={event => setConfirmed(event.target.checked)} />
        <span>{tool === 'veryfront__set_project_inference_policy' ? 'Replace the project inference policy with these arguments. Omitted constraints will be removed.' : 'Run this tool with these arguments.'}</span>
      </label>}
      <button disabled={status === 'Calling tool...' || requiresConfirmation && !confirmed} className="disabled:opacity-50 disabled:cursor-not-allowed rounded-md bg-gray-900 px-3 py-2 text-sm font-medium text-white hover:bg-gray-700 dark:bg-gray-100 dark:text-gray-950 dark:hover:bg-gray-300" type="button" onClick={callTool}>
        Run tool
      </button>

      <div className="mt-4 text-sm font-medium text-gray-900 dark:text-gray-100">{status}</div>
      <div className="mt-3 overflow-hidden rounded-md border border-gray-300 dark:border-gray-700">
        <div className="flex items-center justify-between bg-gray-100 px-3 py-2 text-sm font-medium text-gray-900 dark:bg-gray-900 dark:text-gray-100">
          <span>Output JSON</span>
          <button className="rounded border border-gray-300 bg-white px-2 py-1 text-xs text-gray-900 hover:bg-gray-50 dark:border-gray-700 dark:bg-gray-950 dark:text-gray-100 dark:hover:bg-gray-800" type="button" onClick={copyResponse}>
            {copied ? 'Copied' : 'Copy'}
          </button>
        </div>
      <pre className="max-h-96 overflow-auto whitespace-pre-wrap break-words bg-gray-950 p-4 text-sm text-gray-100">
        <code dangerouslySetInnerHTML={{
    __html: highlightJson(response)
  }} />
      </pre>
      </div>
    </div>
    </details>;
};

<div className="api-operation-signature">
  `veryfront__update_webhook`
</div>

Requires project.agents.write.

## Access

No external-service connection is required. Use a Veryfront credential with access to the requested resources.

**Call type:** Can change resources.

## Arguments

| Field | Type | Required | Description and constraints |
| - | - | - | - |
| `project_reference` | `string` | No | Project ID or slug. |
| `webhook_id` | `string` | Yes | The webhook id. Updates require project.agents.write. When target is omitted, a stored conversation-backed target (`create_new` or existing conversation mode) still requires project.conversations.write. Format: `uuid`. |
| `name` | `string` | No | New webhook name, 1-120 characters. Minimum length: `1`. Maximum length: `120`. |
| `target` | `object` | No | Target invoked by a webhook definition. |
| `prompt_template` | `string` | No | Prompt template for run targets. Not supported for event-only webhooks. Minimum length: `1`. Maximum length: `20000`. |
| `event_filter` | `object or null` | No | Optional incoming event filter. Missing, null, or empty conditions accept every event. |
| `status` | `string` | No | draft, enabled or disabled. Values: `"draft"`, `"enabled"`, `"disabled"`. |

## Example request

Send this JSON-RPC request through an initialized MCP client. Replace sample identifiers and values before calling the tool. See [MCP client setup](/docs/cloud/getting-started/connect-mcp).

```json title="request.json" theme={null}
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "veryfront__update_webhook",
    "arguments": {
      "webhook_id": "00000000-0000-4000-8000-000000000000"
    }
  }
}
```

## Result

The published output shape is summarized below. Inspect both the MCP response content and `isError` when handling a call.

| Field | Type | Required | Description and constraints |
| - | - | - | - |
| `id` | `string` | Yes | The webhook id. Pass it as `webhook_id` to the other webhook operations. Format: `uuid`. |
| `project_id` | `string` | Yes | Project identifier associated with the record. Format: `uuid`. |
| `name` | `string` | Yes | Human-readable name for the record. |
| `source` | `string` | Yes | The source associated with this record. Value: `"webhook"`. |
| `target` | `object` | Yes | Structured target details associated with this record. |
| `prompt_template` | `string or null` | Yes | The prompt template associated with this record. |
| `event_filter` | `object or null` | Yes | Optional incoming event filter. Missing, null, or empty conditions accept every event. |
| `status` | `string` | Yes | Lifecycle status for the record. Values: `"draft"`, `"enabled"`, `"disabled"`. |
| `runtime_target_kind` | `string` | Yes | The runtime target kind associated with this record. Values: `"main_branch"`, `"environment"`, `"preview_branch"`. |
| `runtime_target_environment_id` | `string or null` | Yes | The runtime target environment id associated with this record. |
| `runtime_target_branch_id` | `string or null` | Yes | The runtime target branch id associated with this record. |
| `definition_source` | `string` | Yes | The definition source associated with this record. Values: `"manual"`, `"source"`. |
| `source_trigger_id` | `string or null` | Yes | The source trigger id associated with this record. |
| `source_path` | `string or null` | Yes | The source path associated with this record. |
| `source_hash` | `string or null` | Yes | The source hash associated with this record. |
| `ingress_id` | `string` | Yes | The public id in `webhook_url` that external senders post to. |
| `webhook_url` | `string` | Yes | The webhook url associated with this record. |
| `created_by_user_id` | `string` | Yes | The created by user id associated with this record. Format: `uuid`. |
| `enabled_at` | `string or null` | Yes | The enabled at associated with this record. |
| `disabled_at` | `string or null` | Yes | The disabled at associated with this record. |
| `disabled_reason` | `string or null` | Yes | The disabled reason associated with this record. |
| `created_at` | `string` | Yes | Creation timestamp in ISO 8601 format. |
| `updated_at` | `string` | Yes | Last update timestamp in ISO 8601 format. |

## Full schemas

<CodeGroup>
  ```json title="input-schema.json" theme={null}
  {
    "type": "object",
    "properties": {
      "project_reference": {
        "type": "string",
        "description": "Project ID or slug."
      },
      "webhook_id": {
        "type": "string",
        "format": "uuid",
        "description": "The webhook id. Updates require project.agents.write. When target is omitted, a stored conversation-backed target (create_new or existing conversation mode) still requires project.conversations.write."
      },
      "name": {
        "type": "string",
        "minLength": 1,
        "maxLength": 120,
        "description": "New webhook name, 1-120 characters."
      },
      "target": {
        "type": "object",
        "properties": {
          "kind": {
            "type": "string",
            "enum": [
              "agent",
              "task",
              "workflow",
              "event"
            ],
            "description": "Target kind invoked or stored by the webhook."
          },
          "id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "description": "Target identifier: agent id, task target, workflow id, or event for store-only webhooks."
          },
          "conversation_mode": {
            "type": "string",
            "enum": [
              "create_new",
              "existing",
              "none"
            ],
            "description": "Conversation behaviour for an agent target. Defaults to none. Use create_new for an agent that delegates with invoke_agent - a run with no conversation cannot be paused for delegation. Agent targets run headlessly by default; create_new or existing creates or appends a conversation message. Agent targets with conversation mode create_new or existing also require project.conversations.write."
          },
          "conversation_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid",
                "description": "Conversation identifier associated with the record."
              },
              {
                "type": "null",
                "description": "Conversation identifier that scopes the request."
              }
            ],
            "description": "Existing conversation to continue. Only allowed when conversation_mode is existing, and required in that case."
          }
        },
        "required": [
          "kind",
          "id"
        ],
        "additionalProperties": false,
        "description": "Target invoked by a webhook definition."
      },
      "prompt_template": {
        "type": "string",
        "minLength": 1,
        "maxLength": 20000,
        "description": "Prompt template for run targets. Not supported for event-only webhooks."
      },
      "event_filter": {
        "anyOf": [
          {
            "type": "object",
            "properties": {
              "mode": {
                "type": "string",
                "enum": [
                  "all",
                  "any"
                ],
                "description": "Whether all or any filter conditions must match."
              },
              "conditions": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "path": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 255,
                      "description": "Dot path in the incoming payload, for example action or pull_request.state."
                    },
                    "operator": {
                      "type": "string",
                      "enum": [
                        "equals",
                        "not_equals",
                        "in",
                        "exists",
                        "contains"
                      ],
                      "description": "Comparison operator."
                    },
                    "value": {
                      "description": "Comparison value for operators that require one."
                    }
                  },
                  "required": [
                    "path",
                    "operator"
                  ],
                  "additionalProperties": false,
                  "description": "One condition item associated with this record."
                },
                "maxItems": 50,
                "description": "Filter conditions applied before webhook work is created."
              }
            },
            "required": [
              "mode",
              "conditions"
            ],
            "additionalProperties": false,
            "description": "Optional incoming event filter. Missing, null, or empty conditions accept every event."
          },
          {
            "type": "null",
            "description": "Provide the event filter."
          }
        ],
        "description": "Optional incoming event filter. Missing, null, or empty conditions accept every event."
      },
      "status": {
        "type": "string",
        "enum": [
          "draft",
          "enabled",
          "disabled"
        ],
        "description": "draft, enabled or disabled."
      }
    },
    "required": [
      "webhook_id"
    ],
    "additionalProperties": false,
    "$schema": "http://json-schema.org/draft-07/schema#",
    "description": "Arguments for the update_webhook tool."
  }
  ```

  ```json title="output-schema.json" theme={null}
  {
    "type": "object",
    "properties": {
      "id": {
        "type": "string",
        "format": "uuid",
        "description": "The webhook id. Pass it as webhook_id to the other webhook operations."
      },
      "project_id": {
        "type": "string",
        "format": "uuid",
        "description": "Project identifier associated with the record."
      },
      "name": {
        "type": "string",
        "description": "Human-readable name for the record."
      },
      "source": {
        "type": "string",
        "const": "webhook",
        "description": "The source associated with this record."
      },
      "target": {
        "type": "object",
        "properties": {
          "kind": {
            "type": "string",
            "enum": [
              "agent",
              "task",
              "workflow",
              "event"
            ],
            "description": "Target kind invoked or stored by the webhook."
          },
          "id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "description": "Target identifier: agent id, task target, workflow id, or event for store-only webhooks."
          },
          "conversation_mode": {
            "type": "string",
            "enum": [
              "create_new",
              "existing",
              "none"
            ],
            "description": "Conversation behaviour for an agent target. Defaults to none. Use create_new for an agent that delegates with invoke_agent - a run with no conversation cannot be paused for delegation. Agent targets run headlessly by default; create_new or existing creates or appends a conversation message. Agent targets with conversation mode create_new or existing also require project.conversations.write."
          },
          "conversation_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid",
                "description": "Conversation identifier associated with the record."
              },
              {
                "type": "null",
                "description": "Conversation identifier associated with this result."
              }
            ],
            "description": "Existing conversation to continue. Only allowed when conversation_mode is existing, and required in that case."
          }
        },
        "required": [
          "kind",
          "id"
        ],
        "additionalProperties": false,
        "description": "Structured target details associated with this record."
      },
      "prompt_template": {
        "type": [
          "string",
          "null"
        ],
        "description": "The prompt template associated with this record."
      },
      "event_filter": {
        "anyOf": [
          {
            "type": "object",
            "properties": {
              "mode": {
                "type": "string",
                "enum": [
                  "all",
                  "any"
                ],
                "description": "Whether all or any filter conditions must match."
              },
              "conditions": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "path": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 255,
                      "description": "Dot path in the incoming payload, for example action or pull_request.state."
                    },
                    "operator": {
                      "type": "string",
                      "enum": [
                        "equals",
                        "not_equals",
                        "in",
                        "exists",
                        "contains"
                      ],
                      "description": "Comparison operator."
                    },
                    "value": {
                      "description": "Comparison value for operators that require one."
                    }
                  },
                  "required": [
                    "path",
                    "operator"
                  ],
                  "additionalProperties": false,
                  "description": "One condition item associated with this record."
                },
                "maxItems": 50,
                "description": "Filter conditions applied before webhook work is created."
              }
            },
            "required": [
              "mode",
              "conditions"
            ],
            "additionalProperties": false,
            "description": "Optional incoming event filter. Missing, null, or empty conditions accept every event."
          },
          {
            "type": "null",
            "description": "The event filter returned by the tool."
          }
        ],
        "description": "Optional incoming event filter. Missing, null, or empty conditions accept every event."
      },
      "status": {
        "type": "string",
        "enum": [
          "draft",
          "enabled",
          "disabled"
        ],
        "description": "Lifecycle status for the record."
      },
      "runtime_target_kind": {
        "type": "string",
        "enum": [
          "main_branch",
          "environment",
          "preview_branch"
        ],
        "description": "The runtime target kind associated with this record."
      },
      "runtime_target_environment_id": {
        "anyOf": [
          {
            "type": "string",
            "format": "uuid",
            "description": "The runtime target environment id associated with this record."
          },
          {
            "type": "null",
            "description": "The runtime target environment id returned by the tool."
          }
        ],
        "description": "The runtime target environment id associated with this record."
      },
      "runtime_target_branch_id": {
        "anyOf": [
          {
            "type": "string",
            "format": "uuid",
            "description": "The runtime target branch id associated with this record."
          },
          {
            "type": "null",
            "description": "The runtime target branch id returned by the tool."
          }
        ],
        "description": "The runtime target branch id associated with this record."
      },
      "definition_source": {
        "type": "string",
        "enum": [
          "manual",
          "source"
        ],
        "description": "The definition source associated with this record."
      },
      "source_trigger_id": {
        "type": [
          "string",
          "null"
        ],
        "description": "The source trigger id associated with this record."
      },
      "source_path": {
        "type": [
          "string",
          "null"
        ],
        "description": "The source path associated with this record."
      },
      "source_hash": {
        "type": [
          "string",
          "null"
        ],
        "description": "The source hash associated with this record."
      },
      "ingress_id": {
        "type": "string",
        "description": "The public id in webhook_url that external senders post to."
      },
      "webhook_url": {
        "type": "string",
        "description": "The webhook url associated with this record."
      },
      "created_by_user_id": {
        "type": "string",
        "format": "uuid",
        "description": "The created by user id associated with this record."
      },
      "enabled_at": {
        "type": [
          "string",
          "null"
        ],
        "description": "The enabled at associated with this record."
      },
      "disabled_at": {
        "type": [
          "string",
          "null"
        ],
        "description": "The disabled at associated with this record."
      },
      "disabled_reason": {
        "type": [
          "string",
          "null"
        ],
        "description": "The disabled reason associated with this record."
      },
      "created_at": {
        "type": "string",
        "description": "Creation timestamp in ISO 8601 format."
      },
      "updated_at": {
        "type": "string",
        "description": "Last update timestamp in ISO 8601 format."
      }
    },
    "required": [
      "id",
      "project_id",
      "name",
      "source",
      "target",
      "prompt_template",
      "event_filter",
      "status",
      "runtime_target_kind",
      "runtime_target_environment_id",
      "runtime_target_branch_id",
      "definition_source",
      "source_trigger_id",
      "source_path",
      "source_hash",
      "ingress_id",
      "webhook_url",
      "created_by_user_id",
      "enabled_at",
      "disabled_at",
      "disabled_reason",
      "created_at",
      "updated_at"
    ],
    "additionalProperties": false,
    "description": "A project webhook.",
    "$schema": "http://json-schema.org/draft-07/schema#"
  }
  ```
</CodeGroup>

<McpToolCall
  tool="veryfront__update_webhook"
  requiresConfirmation={true}
  initialArguments={{
"webhook_id": "00000000-0000-4000-8000-000000000000"
}}
/>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.