Skip to main content

Private chats

A private chat is a 1:1 conversation between one person and a bot. In authorization terms the conversation is the person: on every platform, a private chat's identifier is the identifier of the person in it — a Telegram DM with user 123456789 is chat 123456789. Authorizing a private chat therefore authorizes exactly one sender, and nothing else.

Authorization introduces the two channel models, membership and sender. Private chats are the sender model in its purest form, and they follow it on every platform: a group's platform decides its mode, but a 1:1 chat is sender-authorized even on platforms whose groups are membership-mode.

The rule

Private chats are default closed. A bot answers a private message only when all of these hold:

  • the sender has been granted private-chat access for the tenant — their own chat, individually;
  • the sender is not banned;
  • a bot is assigned to the chat.

Everyone else gets silence. The message is received and recorded — the logs show an unauthorized event, and the chat appears in the admin console's Interactions view — but no reply and no error goes back. A stranger who finds the bot and messages it learns nothing from it.

The grant is deliberately narrow, in both directions:

  • A private-chat grant covers that person's own 1:1 chat and nothing else. It confers no access to any group.
  • Group access confers nothing here. Someone who can use the bot in an authorized group — even an admin of that group — still cannot message it privately until granted individually.

How Mesa recognises a private chat

Platform conventions decide what counts as a 1:1 chat:

PlatformWhat makes it private
TelegramThe chat ID is positive — a person's DM chat ID is their user ID. Groups and supergroups have negative IDs.
Slack, Discord (when built)The platform's own DM designation — D… channel IDs on Slack, Discord's DM flag.
Email, SMS, WhatsAppEvery sender is individually authorized: the sender model applies to the whole platform, not just to 1:1 conversations. See Email for how threads are handled.

Granting access

In the admin console, open Channels and add a channel scoped to the tenant, exactly as for a group — but choose the private chat type (Private Chat on Telegram, Direct Message on platforms that use the term) and enter the person's ID as the chat ID. Bots can be selected at the same time; choosing none leaves it to the tenant's default bot assignment.

Authorization and assignment remain two separate conditions, here as everywhere: an authorized private chat with no bot assigned to it produces the same silence as an unauthorized one. The logs tell the two cases apart — see Troubleshooting.

Finding the person's ID

Ask them to message the bot once. The message gets no reply, but it is received, and the chat — whose ID is their user ID — appears in the admin console's Interactions view. On Telegram, @userinfobot also tells a user their own ID.

Everything the console does here exists in the REST API as well — grant, revoke, a per-user check, and a tenant-scoped listing, singly or in batch — under the same authorization surface the console uses. See the API reference.

Revoking access

Remove the channel entry in the admin console, or revoke through the API. From the next message on, the person is treated like any other unauthorized sender: received, logged, unanswered.

One caveat: a private chat can also be covered by an authorization group. Revoking the individual grant removes only that grant — a group-derived claim survives, and the person keeps access until the chat is removed from the group as well.

When the goal is to shut one person out now, a ban is the stronger tool: it overrides every grant, individual or group-derived, on private chats and membership channels alike. See Moderation.

How this differs from group membership

Group or channel (membership)Private chat (sender)
What you authorizeThe channel, onceEach person, individually
Who gets accessEvery member — including people who join laterExactly one person
Where the roster is administeredOn the platform (in Telegram, not in Mesa)In Mesa, by the tenant admin
Excluding one personBan themDon't grant them — or revoke, or ban

Authorizing a large group is a broader grant than it looks, because the group's own membership becomes the access control. A private-chat grant is the opposite extreme: the narrowest grant Mesa has.