> For the complete documentation index, see [llms.txt](https://vibemx.gitbook.io/neuronai-studio/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://vibemx.gitbook.io/neuronai-studio/tools/webhook-tools.md).

# Webhook Tools

Webhook tools call external HTTP endpoints when an agent invokes them. Define the URL, method, headers, and JSON input schema in the studio UI.

## Create a webhook tool

1. Navigate to **Tools** → **Create Tool** (webhook kind)

   ```
   /neuronai-studio/tools/create?kind=webhook
   ```
2. Configure endpoint URL, HTTP method, and optional headers
3. Define input schema
4. Save

> **Screenshot pending:** Webhook tool config with JSON schema editor.
>
> Asset path: `docs/assets/screenshots/tools-webhook.png` Capture: Webhook tool edit page — dark theme, 1440×900

## Request flow

```mermaid
sequenceDiagram
    participant Agent as Agent
    participant Tool as WebhookTool
    participant API as External HTTP API

    Agent->>Tool: invoke with args
    Tool->>API: HTTP request
    API-->>Tool: response body
    Tool-->>Agent: formatted result
```

## Security: host allowlist

Webhook tools validate the target host against `webhook_allowed_hosts` in config:

```env
NEURONAI_STUDIO_WEBHOOK_ALLOWED_HOSTS=api.example.com,hooks.slack.com
```

Default is `*` (allow all). **Restrict this in production** to prevent SSRF attacks from malicious tool configurations.

## Timeout

```env
NEURONAI_STUDIO_WEBHOOK_TIMEOUT=15
```

Requests exceeding this timeout (seconds) fail with an error returned to the agent.

## When to use webhooks vs builder tools

| Scenario                     | Recommendation      |
| ---------------------------- | ------------------- |
| Call existing REST API       | Webhook tool        |
| Complex PHP logic, DB access | Builder tool        |
| Production-grade typed tool  | Export to PHP class |

## Configuration reference

```php
'webhook_allowed_hosts' => env('NEURONAI_STUDIO_WEBHOOK_ALLOWED_HOSTS', '*'),
'webhook_timeout' => (int) env('NEURONAI_STUDIO_WEBHOOK_TIMEOUT', 15),
```

See [Security & Access](/neuronai-studio/workflows/security-and-access.md).

## Next steps

* [Builder Tools](/neuronai-studio/tools/builder-tools.md)
* [Registry & Codegen](/neuronai-studio/tools/registry-and-codegen.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://vibemx.gitbook.io/neuronai-studio/tools/webhook-tools.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
