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

# Webhook Integration Guide [Coming Soon]

## Introduction

This guide will help you integrate and set up webhooks for inbound AI-powered calls. It explains how to configure webhook settings, set up an API receiver, and dynamically replace variables in AI-generated prompts.

## Prerequisites

Before you begin, make sure you have:

* An account for your application.
* A valid URL to handle webhook calls.

## Configure Webhook Settings

To get started, set up your webhook URL, headers, and query parameters.

* Enter your webhook URL
* Add your API authentication details, such as bearer tokens or API keys.
* Include any dynamic parameters you wish to pass, such as customer\_name and order\_status.
  <img src="https://mintcdn.com/trilletai/EdcrcTJCQ9witVNd/images/Inboundwebhook.png?fit=max&auto=format&n=EdcrcTJCQ9witVNd&q=85&s=9e8edabbf1fbe5db9d130651100186f0" alt="title" width="1097" height="679" data-path="images/Inboundwebhook.png" />

## Create an API Receiver

* Create an API endpoint to process incoming webhook requests.

```bash theme={null}
app.get('/get-webhook', (req, res) => {
    console.log("Request Headers: ", req.headers);
    console.log("Request Query: ", req.query);

    // Respond with variables for AI prompt
    res.status(200).json({
        variables: {
            customer_name: "John Doe",
            order_status: "shipped"
        }
    });
});
```

Note: The API response should always include the variables object in the following format:

```bash theme={null}
{
    "variables": {
        "customer_name": "John Doe",
        "order_status": "shipped"
    }
}
```

## Replace Variable in AI Prompts

Use the returned variables from your webhook to dynamically update AI prompts.

Example Prompt in Call Flow Designer:

```bash theme={null}
Hello, {{customer_name}}, your order status is {{order_status}}.
```

When the webhook processes the request, variables are replaced dynamically:

```bash theme={null}
Hello, John Doe, your order status is shipped.
```
