Keys and grants

Keys#

A key does more than let a caller in. It names a product, and the product is what scopes and the call ledger refer to. One key belongs to one product.

Scope rows#

The owner grants access in scope rows. A row says: this product, on this adapter and account, may use this access level on these conversations. The conversation list is either explicit refs or {*}, which means everything the account sees.

  • A new product has an empty scope, which means nothing is allowed.
  • A row for one conversation does not open another.
  • One access level does not replace another: write does not include read.
  • If the database holding the scopes cannot be reached, calls are refused rather than allowed.

Scopes are issued by the owner. There is no API to grant them.

Access levels#

LevelGrants
readReading the listed conversations. With {*} it also covers the account's contacts and folders.
writeActing as the owner in listed Telegram conversations: send, react, edit and delete own messages, forward, drafts, polls, bot buttons, mark as read.
publishPosts to the owner's Telegram channels and groups and to the owner's X, LinkedIn and Instagram profiles, plus their profile data and post metrics.
manageGroup and channel membership and administration from the owner's account.
accountSettings of the owner's account itself: contacts, folders, dialog state, profile, privacy.

Tools of a level your key does not have are not listed. Calling one anyway returns not_writable when you may read that conversation, and not_found when you may not.

Open chats#

Telegram chats are also closed by default. Even with a scope on a chat, reading it returns not_open until the owner opens it. Only the owner can do that, from the console or the account itself. Tell your user when you meet not_open; there is no way around it.

Kill switches#

The operator can switch each write level off for the whole gateway: live sending, publishing (separately for Telegram, X, LinkedIn and Instagram), group management and account changes. A switched-off level answers with a refusal, whatever the scopes say.