---
title: "Telegram Webhook"
method: POST
path: "/api/webhooks/telegram"
tags: ["webhooks"]
---

# Telegram Webhook

`POST /api/webhooks/telegram`

Receive Telegram Bot API updates (callback queries from inline button taps).

Security: Telegram sends X-Telegram-Bot-Api-Secret-Token header on every update.
We verify it matches TELEGRAM_WEBHOOK_SECRET (set via setWebhook secret_token param).
Returns 403 on mismatch to reject spoofed requests.

Handles:
- callback_query: inline button taps (Approve / Edit / Skip)
- message: text replies (edit direction from Edu)

Always returns {"ok": true} on success — Telegram retries on non-200.

## Headers

- `X-Telegram-Bot-Api-Secret-Token` string, nullable

## Response `200`

Successful Response

- object

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.dev/rethoric/apis/rethoric-os.md) · [All operations](https://skmtc.dev/rethoric/apis/rethoric-os/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/rethoric/rethoric-os/revisions/76b6d39426f6/schema)
