Developer documentation

Telegram deep links, action bars and Web events

Route Telegram links by type and validate action-bar capabilities and WebView event origins.

GetTGAPI editorial teamUpdated
Documentation notesReviewed

Based on official sources and independently maintained by GetTGAPI. Documentation and glossary →

On this page
  1. Parse links before choosing an action
  2. Action bars reflect current context
  3. Web events need a trust boundary
  4. Implementation recommendations

Parse links before choosing an action

t.me and tg: routes can represent messages, invites, themes, invoices and other features. Use documented fallback behavior for unknown routes instead of guessing a username. MTProto IDs and Bot API dialog IDs are not interchangeable.

Action bars reflect current context

Contact, reporting and Business Bot controls depend on peer settings and their updates. A stale button must not bypass current permissions.

Web events need a trust boundary

Games, payment pages and Mini Apps use defined events through environment-specific bridges. A familiar event name does not establish a trusted sender.

Implementation recommendations

Allowlist origins, message structures and actions. Tolerating unknown fields must not become accepting arbitrary commands. Route payments, authorization and joining through their confirmation flows. Log type and result rather than entire links containing authentication tokens.