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

# Webhook node

> Call external HTTP APIs from a workflow

Calls an external HTTP endpoint, optionally stores the response, and then advances through the `next` edge.

## Configuration

* `url`: HTTP endpoint to call
* `method`: HTTP method, defaults to `POST`
* `headers`: Header object
* `body_template`: JSON body template
* `save_response_to`: Variable name to store the response (optional)
* `provider_model_name`: Required when using AIField
* `ai_field_config`: AI field-resolution settings

## Workflow library example

```javascript theme={null}
workflow.addNode("create_ticket", {
  type: "webhook",
  url: "https://api.example.com/tickets",
  method: "POST",
  headers: {
    "X-API-Key": "${ENV:SUPPORT_API_KEY}"
  },
  bodyTemplate: {
    phone: "{{context.phone_number}}",
    message: "{{last_user_input}}"
  },
  saveResponseTo: "ticket"
});
```

## API payload shape

When using the Platform API directly, use snake\_case keys:

```json theme={null}
{
  "node_type": "webhook",
  "config": {
    "url": "https://api.example.com/tickets",
    "method": "POST",
    "headers": {
      "X-API-Key": "${ENV:SUPPORT_API_KEY}"
    },
    "body_template": {
      "phone": "{{context.phone_number}}",
      "message": "{{last_user_input}}"
    },
    "save_response_to": "ticket"
  }
}
```

## Usage patterns

**Create CRM record**

```mermaid theme={null}
graph LR
    A[Wait for response] --> B[Webhook<br/>Create lead]
    B --> C[Send text<br/>Confirmation]
```

**Notify another system**

```mermaid theme={null}
graph LR
    A[Decide<br/>Urgent?] --> B[Webhook<br/>Page team]
    B --> C[Handoff]
```
