Send message
Sends a message to the customer identified by customer_token. If the customer doesn't exist (or no token is provided), a new customer is created.
The shape of message depends on message.type. See the request examples for each supported type.
Path Parameters
- Type: stringcustomer
_token requiredCustomer token. If unknown, pass any unique value — a new customer will be created.
Body
required
application/json
- messagerequired
- typeDiscriminatorenumconst:textrequiredvalues
- text
- messageType: stringrequired
Message body.
- payloadType: string
Optional payload string returned to your bot flow.
- Type: objectcustomer
Optional customer fields used when creating a new customer.
Responses
- application/json
- application/json
Request Example for post/send/{customer_token}/
curl 'https://chat.landbot.io/v1/send/{customer_token}/' \
--request POST \
--header 'Content-Type: application/json' \
--header 'Authorization: Token YOUR_CHANNEL_TOKEN' \
--data '{
"customer": {
"name": "Samuel"
},
"message": {
"type": "text",
"message": "Hello",
"payload": "$1"
}
}'
{
"success": true,
"customer": {
"id": 42,
"name": "Samuel",
"phone": "34697882898",
"email": "sam@helloumi.com",
"postal_code": "46021",
"country": "GB",
"token": "SDFRL4TOMFTEWERY262NF"
}
}