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
  • channel_id
    Type: integer
    required

    Identifier of the channel.

Body
required
application/json
  • url
    Type: stringFormat: uri
    required

    Your endpoint that will receive message payloads.

  • name
    Type: string

    Human-readable label for the hook.

  • token
    Type: string

    Optional shared secret. Sent back in the Authorization header 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
  }
}