Table of Contents
Webhook Block for Advanced Users
Updated
by Abby
Note: If you already have experience with REST API then this article is for you! If not, we recommend checking out our beginner's guide to the webhook block
What is the Webhook Block?
The Webhook block is Landbot’s interface for making RESTful API calls directly from within your bot. If you require real-time updates or polling, use MessageHooks rather than this block.
1. Webhook Configuration
A. Url & method

- Choose the appropriate HTTP method: GET, POST, PUT, PATCH, or DELETE.

- Input your API endpoint (must begin with
https://).
Important: Only HTTPS endpoints are accepted. You will not be able to save or use HTTP endpoints.

- Dynamic Paths: Insert Landbot fields directly into the URL path: Example:
https://api.domain.com/users/@{user_id}(@{field}for custom fields,¿·@fields·?for system fields)
- You cannot use dynamic fields in the domain/subdomain section (
@{field}.domain.comis not supported)
B. Query Parameters ("Send Params")
- Add query parameters via Send Params as key-value pairs (e.g.,
user=Sam). - Params are appended to the endpoint URL and highlighted in green in the preview.

The added parameters will appear in the preview url in green:

C. HTTP Headers
- By default, no headers are sent.
- Enable and set any required headers, such as:
- Content-Type — e.g.
application/json - Authorization — e.g.
Bearer YOUR_TOKEN - User-Agent — Not sent by default; add if required by your API
- Content-Type — e.g.
Note: The required headers depend on the external service. For JSON requests, ensure all body fields have values or the API may reject your call.

D. Request Body

- Only JSON body payloads are supported.
- Reference Landbot fields using
"@field"format inside your JSON.
{
"email": "@email",
"name": "@name",
"customField": "@customfield"
}- All field variables must be quoted strings.
- Invalid or non-JSON payloads will cause a validation error.

Meaning if you send an integer, even though it's wrapped in quotation marks it will remain an integer
E. Testing Your API Call
- Use the Test Request button to send a real API request.

- Fill in placeholder values for any dynamic fields.

- After the test, you’ll see the response status and body—use this to determine the structure for field saving and routing.

- Fill in placeholder values for any dynamic fields.
- Adjust and retest as needed before saving changes.
2. Saving and Mapping Response Data
You might want to save the response of a request as fields every time it's triggered to:
- Split bot flow ⟶ For example, check a user's record in your CRM to know if he is an existing customer.
- Display certain data as options in the next step using a Dynamic Data block ⟶ For example, Get up-to-date inventory data from the external database and display it as products for purchase.
- Store a record ⟶ For example, you can get users’ data from a third-party API and save it in your own database.
You can do that in the ‘Save Responses as Fields section

- By default, the complete response body is stored.
- To extract specific data, map JSON fields from the API response to Landbot variables:
- First, test your request to view the response structure.
- Select the desired keys using the dropdown.

- Map multiple keys/fields as needed (date types are not supported).

3. Output
- The Webhook block exposes two outputs:

- Green: The request received any HTTP response (including 4xx/5xx status codes).
- Red: The endpoint was unreachable or network error occurred.
4. Advanced Webhook Configurations
A. Response Routing
This section allows you to split the flow based on the response status code.

- Add custom paths by HTTP status code (range matching not currently supported).
- If a status code isn’t explicitly routed, the default path is used.
- Example: Route 200, 404, and 401 separately for different flows.
Tip: Remember to reconnect each output to your flow after editing routes, otherwise connections may break.

B. Domain Variables

Domain variables allow developers to switch predefined base URLs in a simple manner. Instead of typing a specific URL for each Webhook block in a static manner, Domain Fields can be selected from the Domain Fields button below the URL:

Once a Domain Field is set, you can continue the edit adding the rest of the path, and even add more Landbot Fields by clicking on the Fields button:

Or if needed, you can always delete the current Domain Field and path by clicking on the X next to the URL:

Domain Variables (Headers)
Domain Fields can also be set up with specific Headers. Click on ‘Domain Fields and select the one you want, and automatically you will see below how the Custom Header changes accordingly.

How to Set Domain Variables
From the Webhook dashboard section, you can add, edit, and delete Domain Fields. Go to the ‘URL & Method’ section, click on ‘Set Domain Fields’ and you will be redirected to the Dashboard:


From there, if you want to create a new Domain Field, click on ‘Add New Domain Field’ and fill out the required information (name, domain URL, and headers, if needed).

Change environment (edit a Domain Field)
If at some point you need to change the values of a Domain Field because you are changing from development to production, for example, instead of changing every Webhook, you only need to edit the Domain Field that is being used. The changes will be applied automatically in all your current bots where you are using such Domain Field.
Landbot Public IP
Find here Landbot’s IPs in case you need to whitelist them:
34.77.31.159 | 23.251.142.192 |
Limitations to keep in mind
- No SOAP/XML support (REST/JSON only)
- HTTPS only (non-SSL URLs are not accepted)
- 60-second timeout per request
- SSL Errors: Landbot does not display SSL errors. If the webhook silently fails, verify your API’s SSL certificate externally.
- Date type variables not currently supported in webhook block
FAQs & Troubleshooting
Why am I getting a 500 error?
How do I know if the issue is with Landbot or with my API?
Can I extend the webhook timeout?
Is this compatible with all channels?
How can I send files?
Here's a workaround to download the file