Quickstart
Make your first Landbot API call in under a minute.
This page walks through making a single authenticated request against the Platform API and reading the response. If you haven't already, grab your agent token from app.landbot.io/gui/settings/account.
Prerequisites
- A Landbot workspace — new to Landbot? The Help Center's Getting started and Build a bot cover creating an account and your first bot.
- Your agent token (in Settings → Account in the dashboard)
Make the call
The simplest non-trivial endpoint is GET /channels/ — it returns the channels in your workspace, requires no path parameters, and is safe to call.
curl https://api.landbot.io/v1/channels/ \
-H "Authorization: Token YOUR_AGENT_TOKEN" \
-H "Content-Type: application/json"
const res = await fetch('https://api.landbot.io/v1/channels/', {
headers: {
'Authorization': 'Token YOUR_AGENT_TOKEN',
'Content-Type': 'application/json',
},
});
const data = await res.json();
console.log(data);
import requests
res = requests.get(
'https://api.landbot.io/v1/channels/',
headers={
'Authorization': 'Token YOUR_AGENT_TOKEN',
'Content-Type': 'application/json',
},
)
print(res.json())
Read the response
A successful call returns 200 OK with a body like this:
{
"success": true,
"total": 3,
"channels": [
{
"id": 8,
"name": "Web chat",
"type": "webchat",
"active": true,
"created_at": 1485789228.878516,
"token": "H-8-GXQB4SYFQITIB9XZ"
}
]
}
The shape — success, total, plus a list keyed by the resource name — is consistent across every listing endpoint in the Platform API. See Pagination for how total and offset/limit work together.
Make a write call
Same auth, just a POST with a JSON body. To send a text message to a customer, swap 42 for a real customer ID from your /customers/ list:
curl https://api.landbot.io/v1/customers/42/send_text/ \
-X POST \
-H "Authorization: Token YOUR_AGENT_TOKEN" \
-H "Content-Type: application/json" \
-d '{"message": "Hello from the API"}'
const res = await fetch('https://api.landbot.io/v1/customers/42/send_text/', {
method: 'POST',
headers: {
'Authorization': 'Token YOUR_AGENT_TOKEN',
'Content-Type': 'application/json',
},
body: JSON.stringify({ message: 'Hello from the API' }),
});
const data = await res.json();
console.log(data);
import requests
res = requests.post(
'https://api.landbot.io/v1/customers/42/send_text/',
headers={
'Authorization': 'Token YOUR_AGENT_TOKEN',
'Content-Type': 'application/json',
},
json={'message': 'Hello from the API'},
)
print(res.json())
You'll get a 200 OK with {"success": true}. The same call reaches the customer on whatever channel they're on — webchat, WhatsApp, Messenger, APIchat. One channel-specific caveat: on WhatsApp, free-form messages like this are only delivered within 24 hours of the customer's last inbound message; outside that window you must send a pre-approved WhatsApp template instead.
If the call fails (403, 412, 422), the response body is {"errors": {"field_name": ["…message…"]}}. See Errors for which codes are safe to retry.
What's next
-
Authentication — The Platform API and APIchat use different tokens. Learn which is which.
-
API reference — Browse every endpoint with the interactive playground.
-
Rate limiting — 10 req/sec cap, what
429looks like, and how to back off. -
Errors — What each 4xx means and which are safe to retry.