Skip to content

Telegram webhook returns 405 Method Not Allowed #4417

@taolong75

Description

@taolong75

Description

Telegram webhook mode returns 405 Method Not Allowed when Telegram tries to POST to the webhook endpoint.

Setup

  • OpenClaw version: 2026.1.29 (commit 87267fa)
  • Tailscale funnel mode enabled
  • Webhook URL: https://<hostname>.ts.net/telegram-webhook

Steps to Reproduce

  1. Configure Telegram webhook:
{
  "gateway": { "tailscale": { "mode": "funnel" } },
  "channels": {
    "telegram": {
      "webhookUrl": "https://<hostname>.ts.net/telegram-webhook"
    }
  }
}
  1. Gateway logs show: webhook listening on https://<hostname>.ts.net/telegram-webhook

  2. Send a Telegram message to the bot

  3. Check webhook status:

curl -s "https://api.telegram.org/bot<token>/getWebhookInfo" | jq

Expected Behavior

Telegram webhook should receive POST requests and process messages.

Actual Behavior

Telegram reports:

{
  "last_error_message": "Wrong response from the webhook: 405 Method Not Allowed"
}

Testing the endpoint manually also returns 405:

curl -X POST -H "Content-Type: application/json" -d '{"test":true}' https://<hostname>.ts.net/telegram-webhook
# Returns: Method Not Allowed

Workaround

Using long-polling mode (no webhookUrl) works correctly with ~7-15 second latency.

Environment

  • OS: Linux (WSL2)
  • Node: 24.12.0
  • Tailscale: funnel mode active and verified working for other endpoints

Notes

The gateway root URL (/) responds correctly, and the webhook endpoint is registered in logs, but POST requests are rejected with 405.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions