Developer docs

8. Errors and limits

On this page

Error{code, type, message, retry_after} — see transport.proto. Clients must handle:

  • 420 FLOOD_WAIT: wait retry_after seconds before retrying that method.
  • 401 AUTH_REQUIRED / SESSION_REVOKED: drop the token and show login.
  • 404 METHOD_NOT_FOUND: method unsupported by this server layer.
  • 303 DC_MIGRATE: repeat the request on DC dc_id (home or this request only, see migrate_scope and §16.5). Limits are announced in ServerHello.config.

8.1 Abuse limits and moderation

Every rate limit answers 420 with retry_after (seconds). Risky sign-ups and bulk actions may instead get 403 CAPTCHA_REQUIRED, and budgets depend on the client tier (§21). The type says which kind:

typeMeaningClient behaviour
FLOOD_WAITa token bucket is empty (per session, per user across all sessions, per method, per chat, new-account budgets, duplicate content)disable the action and show a countdown; retry after retry_after
SLOWMODE_WAITthe group’s slow mode; retry_after is the time leftcountdown in the composer
PEER_FLOODthe daily budget of new cold peers is used up (people who are not your contact, don’t have you as a contact and never wrote to you); retry_after is when the oldest one ages outbanner explaining the limit; messages to people you already talk to keep working
SMS_DAILY_LIMITthe server’s daily SMS cost cap“try later”

Limits (defaults; operators tune TELEVO_*, see server/internal/config/abuse.go):

LimitScopeDefault
any methodper session30/s, burst 100
any methodper user, all sessions together50/s, burst 150
anonymousper IP5/s, burst 30
messages (send, album item, forward)per user20/s, burst 60
messages into a group/channelper chat, all senders30/s, burst 150
same text or media into > 5 distinct groups/channelsper user, 10 minFLOOD_WAIT
new cold peersper user per 24 h5 (account < 24 h), 20 (< 30 days), 50 (older); x4 verified; halved after reports from 3+ users
create groups/channelsper user per day3 (new account) / 50
join chats (public or link)per user per day20 (new) / 500
add membersper added user per day50 (new) / 2000
forwardper message per day300 (new) / 20000
wrong invite hashesper user20/hour
login codesper IP 10/h, per network 60/h, per identifier 3 then 1/30 s, per phone prefix (+ and 5 digits) 30/h, SMS per day 1000
SetPassword with a wrong current passwordper user5/hour
Bot APIper bot: 30 req/s; 30 msg/s; 1 msg/s per private chat (burst 3); 20 msg/min per groupTelegram parity; 429 with parameters.retry_after

Moderation. An account (users and bots alike) has a ModerationState; the self user (GetMe, UserUpdated for me) carries User.moderation = ModerationStatus{state, denied, until, reason, appeal_url, new_account_until}. denied is the effective set of withheld capabilities (state + targeted + new-account), so clients disable exactly those actions. The capability matrix:

Capabilityactivenew account (< 24 h)limitedfrozenbanned
send_messages✓✓✓––
message_strangers (DMs, secret chats, calls, adding to groups)✓✓ (PEER_FLOOD budget)–––
media_to_strangers (links/media/forwards to cold peers)✓––––
create_chats✓✓ (3/day)✓––
public_chats (public @username on a chat)✓✓–––
join_public (public chats and invite links)✓✓ (20/day)–––
invite_users✓✓ (50/day)✓ (contacts only)––
calls✓✓✓ (contacts only)––
edit_profile✓✓✓––
create_bots✓✓–––
sessionskeptkeptkeptkeptrevoked, login refused (USER_BANNED)

Moderators can also withhold single capabilities from an otherwise active account. A withheld capability fails with 403 USER_RESTRICTED and Error.capability set to the lowercase name above. A frozen account is read-only: every method outside a fixed allowlist (reads, own settings, sessions, leaving chats, ending calls, reports, updates) fails with 403 ACCOUNT_FROZEN; messages to the appeal bot (appeal_url, televo://resolve?domain=<bot>) still go through, for limited accounts too. States may carry an expiry (until); the server lifts them automatically. Accounts are limited automatically (7 days, queued for operator review) when 10 distinct established accounts (older than 7 days, not restricted themselves) report them within 24 h; verified accounts are never restricted automatically.

Chats have a moderation state too: CHAT_FROZEN (nobody posts or joins) and CHANNEL_BANNED (inaccessible). Chat.moderation_state tells members.

8.2 Content labels

  • Chat.sensitive: the owner (an admin with change_info) labels a group/channel (EditChat.sensitive); moderators can force it (sensitive_locked, the owner gets 403 SENSITIVE_LOCKED when clearing it).
  • restriction_reason (Chat and User/bots): {platform, reason, text} as in Telegram; platform is all | ios | android | web | macos | windows | linux. A client whose platform matches (or all) shows text instead of the content.
  • UsersService/GetContentSettings / SetContentSettings: the account’s sensitive-content opt-in, stored on the server. With age_confirmation_required, enabling needs confirm_age once (403 AGE_VERIFICATION_REQUIRED). Restricted accounts can’t change it (sensitive_can_change).
  • Clients blur sensitive chats (avatar, last message, media) and ask before opening unless opted in. Search and discovery leave out sensitive chats unless opted in, chats restricted on the caller’s platform (ClientHello.system) and banned chats. The message index is blind (§14), so filtering is per chat; chats you are in always show.
  • Messages: photo/video spoiler (InputPhoto.spoiler, InputDocument.spoiler) blurs a single media item; the Bot API exposes it as has_spoiler / has_media_spoiler.

Generated from docs/PROTOCOL.md in the Telvoro repository. Wire names such as televo.v1 are unchanged.