Create message hook
Registers a new message hook for the given channel. Landbot will POST messages to your url; if you provide a token it is sent as Authorization: Token <token> on each delivery.
Path Parameters
- Type: integerchannel
_id requiredIdentifier of the channel.
Body
required
application/json
- Type: stringFormat: uriurlrequired
Your endpoint that will receive message payloads.
- Type: stringname
Human-readable label for the hook.
- Type: stringtoken
Optional shared secret. Sent back in the
Authorizationheader on each delivery.
Responses
- application/json
- application/json
Request Example for post/channels/{channel_id}/message_hooks/
curl https://api.landbot.io/v1/channels/1/message_hooks/ \
--request POST \
--header 'Content-Type: application/json' \
--header 'Authorization: Token YOUR_AGENT_TOKEN' \
--data '{
"url": "https://api.test.com/landbot/",
"token": "1234567890qwerty",
"name": "1234 Hook"
}'
{
"success": true,
"hook": {
"id": 23,
"url": "https://api.test.com/landbot/",
"token": "1234567890qwerty",
"name": "1234 Hook",
"channel_id": 37,
"created_at": 1606743214.897625,
"updated_at": 1606743896.563929
}
}