Account Standing
What an account may not do, as the service's staff decided, and how large a file it may send. Every client of the service keeps to it — over CLEMA, through a transport or the Bot API — and a client reads it to show its person what is barred before they try.
{"id":"1","type":"account.get"}
{
"id": "1",
"type": "account.get",
"ok": true,
"data": {
"restrictions": [
{"kind": "links", "until": "2026-10-28T15:00:00Z", "reason": "Spam"}
],
"limits": {"file_size": 15728640, "transfer_size": 104857600},
"number_rest": 1209600
}
}
number_rest is how long, in seconds, the account's number rests once the
account is deleted — 14 days — for its client to tell
before it is.
limits are how large a file the account may send, in bytes: file_size for
a stored file sent in a message and transfer_size
for a direct transfer — the server's own, 15 MiB and
100 MiB by default, unless staff gave the account others. A client says a file
is too large before it starts to send it, and may offer a larger one directly
instead.
restrictions are those in force, each of one kind, until until or, without
it, until staff lift it, for the reason they gave. What each kind refuses,
with restricted naming the restriction:
| Kind | Refuses |
|---|---|
banned |
Everything: the account's sessions end (session.revoked with reason banned, after account.updated says so), auth.code for its number is refused — with when the ban ends, not why: whoever asks has not shown the number is theirs — and it signs in through no transport. A banned bot is answered restricted by the Bot API and hears nothing: what comes for it waits. The bots of a banned account are accounts of their own, and go on |
send |
message.send, message.forward, message.edit, transfer.create, and file.create: a file is kept to be sent |
files |
A file message other than a voice message, sent or forwarded, and transfer.create; file.create too where voice bars the rest |
voice |
A voice message, sent or forwarded |
calls |
call.create; answering, and calls to the account, are left |
links |
A link in a message's text or a button, sent, forwarded or edited into it, and in a group's title or description |
avatar |
Setting the account's picture, or a group's; taking one away is left |
profile |
profile.update, a custom status set with presence.set, and a group's title or description changed with conversation.update; clearing a status, or hiding, is left |
create_groups |
conversation.create of a group |
create_channels |
conversation.create of a channel |
bots |
Making bots and managing them with the system bot |
transports |
Signing in through a transport: its sessions end, and its clients are told the account is suspended once they give the right password |
{
"id": "7",
"type": "message.send",
"ok": false,
"error": {
"code": "restricted",
"message": "The account may not send links until 2026-10-28T15:00:00Z: Spam",
"restriction": {"kind": "links", "until": "2026-10-28T15:00:00Z", "reason": "Spam"}
}
}
A restriction past its until counts for nothing, so a client stops showing it
then without being told. Any other change reaches every connection of the
account as account.updated, with the body account.get answers, and the
account hears of it from Mandarin: what it may no longer do, for
how long and why, and when a restriction is lifted. Like transport.updated,
account.updated belongs to no stream and carries no seq: a
client calls account.get after authenticating.
Delete the Account
An account is deleted by its owner, at once and for good, with a code
Mandarin writes to its devices — never by SMS — or by the
service's staff. Only a person's client of this protocol asks: a bot, a
transport or the console is answered not_authorized, and so are the
server's own accounts.
{"id":"1","type":"account.code"}
{
"id": "1",
"type": "account.code",
"ok": true,
"data": {"verification_id": "d_3f2a…", "code_length": 6, "expires_in": 300, "resend_in": 60, "sent_to": "app",
"devices": ["Pixel 10", "Mac"], "state": "sent", "next": "app"}
}
The code comes as a message from Mandarin to every session of the account,
this one's too, saying which device asked, with a button that ends that
session; transports do not show it. A new code may be asked for a minute after
the last, five a day; an account that blocked Mandarin gets none and is
answered delivery_failed. The code then deletes the account:
{"id":"2","type":"account.delete","data":{"verification_id":"d_3f2a…","code":"731904"}}
{"id":"2","type":"account.delete","ok":true}
A wrong code is invalid_code, five of them or one past expires_in end it as
verification_expired; the last owner of the staff console is
answered conflict until another holds the role. After the answer every
session of the account ends with session.revoked and reason deleted. A
device away meanwhile learns it as it comes back: auth.token and
auth.refresh with its tokens are answered invalid_token with "reason": "deleted" while those tokens would have lasted, and a client lets the
account go rather than ask to sign in again.
Deleting an account:
- Erases what it said of itself — names, picture, about, status — its contacts, address books, blocks, privacy settings, sessions and its transport accounts. Its ID is never anybody else's.
- Takes its number off it. The number rests for
number_restofaccount.get:auth.codefor it, andphone.codeof an account binding it, are answeredrate_limitedwith"reason": "number_rest"andretry_aftertill the rest is over — which ends on the hour — before any code goes. Then it signs up anew as another account, with another ID, which starts with the restrictions the deleted account had in force — each to its ownuntil, the longer where it has one of a kind — so that a client of the account lists, before it is deleted, those that last past the rest; a ban it keeps is told toauth.codeas an account's is. While it keeps any,phone.codeof an account binding it is answeredconflict, as isphone.set; keeping none, it binds as any free number. Staff may end a rest, or let the restrictions go, sooner. - Deletes the bots it owns: their names are free again, and their tokens let nobody in.
- Hands each group or channel it owns to its admin there longest, else to its
member there longest, people alone; the new owner hears of it from Mandarin.
One with nobody else in it is deleted. The account leaves every group and
channel, told there as
member.removedwhose member says"deleted": true: its messages there are a deleted account's now, and those it signed no longer say so. - Keeps its messages with whoever got them. Its profile reads
"deleted": trueand nothing more, its direct conversations say"peer_deleted": trueand take no messages, it leaves everybody's contacts, requests and blocks, and no search finds it. Its presence is hidden from everybody.