Telegram Analysis API

Version 0.6.2 · Single Telethon client + Flask proxy

Use the X-API-Key header or Authorization: Bearer to authenticate. All endpoints return JSON.

POST /trigger

Fetches the latest messages from the channel/group and (optionally) forwards them to a webhook.

JSON body with 'entity', 'limit' (default 2), and optional 'webhook_url'.

curl -X POST https://<host>/trigger     -H 'Content-Type: application/json'     -H 'X-API-Key: <api_key>'     -d '{"entity": "@canal", "limit": 2}'
GET /message

Returns a single message by ID, keeping the same format as /trigger.

Query params: entity, message_id, optional webhook_url.

curl 'https://<host>/message?entity=@canal&message_id=123'     -H 'X-API-Key: <api_key>'
GET /media/<token>

Serves downloaded files via signed links (signed_url field in the payload).

Tokens expire after MEDIA_URL_TTL_SECONDS and do not require extra headers.

curl -L 'https://<host>/media/<token>'
GET /last-response

Returns the last payload persisted on disk (requires API key).

Useful for debugging what was sent to n8n or another webhook.

curl https://<host>/last-response -H 'X-API-Key: <api_key>'

Need the latest received payload? Make an authenticated request to GET /last-response.