Webhooks#
Webhooks connect your Humuter agents to messaging platforms. When a user sends a message on Telegram or Discord, the platform forwards it to Humuter, which processes it and sends a response.
Telegram#
Register a Telegram bot token to auto-configure the webhook.
bash
curl -X POST https://humuter.com/api/v1/webhooks/telegram \
-H "Authorization: Bearer hmt_your_key" \
-H "Content-Type: application/json" \
-d '{"agent_id": "ag_abc123", "token": "123456:ABC-DEF"}'Incoming Message Format#
Telegram sends updates in this format (handled automatically by Humuter):
json
{
"update_id": 123456789,
"message": {
"message_id": 1,
"from": {
"id": 987654321,
"first_name": "John"
},
"chat": {
"id": 987654321,
"type": "private"
},
"text": "Hello!"
}
}You don't need to handle this payload yourself. Humuter processes Telegram updates automatically and routes them to the correct agent.
Discord#
Register a Discord bot token to connect your agent.
bash
curl -X POST https://humuter.com/api/v1/webhooks/discord \
-H "Authorization: Bearer hmt_your_key" \
-H "Content-Type: application/json" \
-d '{"agent_id": "ag_abc123", "token": "your-discord-bot-token"}'Response#
json
{
"success": true,
"channel": "discord",
"agent_id": "ag_abc123",
"status": "connected"
}Disconnecting#
Remove a channel connection by sending a DELETE request:
bash
curl -X DELETE https://humuter.com/api/v1/webhooks/telegram/ag_abc123 \
-H "Authorization: Bearer hmt_your_key"