Table of Contents
- How to use the webhook block in Landbot
- How do APIs work?
- What API terms do you need to know?
- What is an API key?
- What is an endpoint?
- What request methods can you use?
- What are parameters?
- When do you need a request body?
- How do you make and test an API call?
- What do status codes mean?
- How do you save the API response?
- FAQS & Troubleshooting
How to Use the Webhook Block in Landbot
Updated
by Abby
- How to use the webhook block in Landbot
- How do APIs work?
- What API terms do you need to know?
- What is an API key?
- What is an endpoint?
- What request methods can you use?
- What are parameters?
- When do you need a request body?
- How do you make and test an API call?
- What do status codes mean?
- How do you save the API response?
- FAQS & Troubleshooting
How to use the webhook block in Landbot
The webhook block is Landbot's REST API block: it sends, receives, updates, or deletes data in a third-party system and returns a response you can use in your flow. Landbot's native integrations; Airtable, Mailchimp, Google Sheets, and others, cover many common use cases. Use the webhook block when you need to connect to a system without a native integration: a CRM, a custom database, or an internal tool.
Prefer watching to reading? Watch the webhook walkthrough video below:
This article walks through every part of the webhook block using a real example: the weather API. The weather API is free, but you'll need to sign up for an API key to follow along.
If you need real-time updates or polling instead of a one-off request, use MessageHooks instead.
How do APIs work?
The diagram below shows the request-response cycle. Read "CLIENT" as "webhook block."

What API terms do you need to know?
| Term | Definition |
|---|---|
| API key | A unique passcode of letters and numbers that grants access to an API |
| Endpoint | The digital location where an API receives requests about its resources (the url) |
| Request method | Uses HTTP methods (GET, POST, PUT, DELETE) to tell the API what you want it to do |
| Parameters | Adds extra information, such as variables to the endpoint and is used to filter the response |
| Request body | Some APIs require data to be in JSON format, in that case we will use the request body |
| API call | Process of a client (the webhook block) making an API request to a server |
| Status code | A number code that appears in the body of an API response that tells you if your request was successful or not |
| API server | Authenticates and processes API requests before delivering an appropriate response |
| API response | A response generated by the API server and returned to the client (the webhook block) |
What is an API key?
An API key is a string of letters and numbers that serves as your access code for an API — like a password, but for machines instead of people. Most APIs require one to authenticate requests and track usage, so only authorized users or applications can access the data.
An API key usually goes in the webhook block's Headers section. The exact header key and value format (Bearer vs. Token) depend on the API you're connecting to.

In the weather API example, Customize Headers stays off, because the API key goes in the Parameters section instead. This is uncommon; most APIs expect the key in a header.
What is an endpoint?
An endpoint is the specific URL where an API receives requests and sends responses. It's where your webhook block connects to another application.
The weather API endpoint looks like this:

⚠️ Warning: The webhook block only accepts HTTPS. If you're following along with the weather API and see an HTTP error, add an "S" after "HTTP" in the endpoint and it will usually work.
If you're not a heavy webhook user, you can ignore the Set Domain Fields button. For more on domain variables, see the advanced users guide.
What request methods can you use?
The webhook block supports four HTTP methods to tell the API what you want to do:
● GET — retrieves specific data from the API
● POST — adds new data to the server
● PUT — updates (overwrites) existing resources on the API
● DELETE — deletes existing data from the server

Additional methods appear in the dropdown, but those are for testing purposes and advanced users only.
What are parameters?
Parameters tell the API exactly what data you want or how to handle your request — they act like filters or modifiers on your request. How parameters are set up, and which ones you can use, depends entirely on the API you're connecting to.
In the weather API example, the parameters are key (the API key) and q (the city you want weather for):

When do you need a request body?
You need a request body when the API you're calling requires data in JSON format. For example, if you collected a user's name, email, and phone number and want to send all of it to your CRM, the request body is where that JSON goes:

Add Fields to the request body using the format "@field". Fields keep their original data type when sent — if a Field holds an integer, it's still sent as an integer even though it's wrapped in quotation marks. For example, the @name Field should be added as "@name".
The weather API example doesn't require a request body, so Request Body stays toggled off.
How do you make and test an API call?
An API call is the full cycle: you make a request, the API retrieves the data, and you get a response back. In Landbot, you make this call by clicking Test the request.
If your request uses parameters, add them manually in this section to test. In the weather API example, add the @city variable to test:

What do status codes mean?
A status code is a three-digit number returned with every request that tells you whether it succeeded. The first digit tells you the category: a code starting with 2 means the request succeeded; a code starting with 4 means something went wrong. Use the status code to understand the outcome of your request and decide your next step.

How do you save the API response?
By default, the webhook block saves the entire API response — you'll still need to add a Field to store it. Outside of testing your flow, you rarely want to save the entire response.

After testing the request, click the purple banner to select the specific part of the response you want to save:

In the weather API example, only the current weather gets saved. The extra data isn't needed.
FAQS & Troubleshooting
Is this compatible with all channels?
What if the response takes longer than 60 seconds?
Why am I getting a 500 error?
How can I send files?
How do I add a listener?
How can I connect to ChatGPT?
Why am I not getting a response from Make/Zapier?
How can I display the data from the webhook as buttons?
My bot flow is stopping at the webhook block
If that's not it, make sure the red output is also connected to the flow!