CLEMA protocol

Message Types Summary

Client → Server (Requests)

Type Auth Required Description
connection.hello No Capability negotiation (must be first message)
connection.ping No Connection check
connection.close No Disconnect gracefully
auth.token No Login with access token
auth.refresh No Refresh access token
auth.logout Yes Invalidate tokens and logout
auth.code No Send a sign-in code to a phone number
code.get No See how a code goes, and wait for it on this connection
auth.phone No Sign in, or create the account, with the code sent to a phone
auth.qr No Get a QR code for a signed-in phone to let this client in
qr.get Yes See which client is waiting behind a scanned QR code
qr.accept Yes Let the client behind a scanned QR code in
session.list Yes List the caller's persistent authentication sessions
session.revoke Yes Revoke one session or all sessions except the current one
session.update Yes Say what the current session's client is now: the language its user reads
account.get Yes Get what the account may not do and its file limits
account.code Yes Send a code to delete the account to its devices
account.delete Yes Delete the account for good with that code
phone.get Yes Get the account's phone number
phone.code Yes Send a code to a phone number the account is to use
phone.set Yes Change the account's phone number with that code
push.register Yes Register this session's device for push notifications
push.unregister Yes Stop push notifications to this session's device
activity.set Yes Make this connection active or passive
transport.list Yes List transport adapters and the caller's accounts on them
transport.setup Yes Create the account on one transport and choose its password
transport.password Yes Replace a transport account password
transport.enable Yes Let a transport accept the account again
transport.disable Yes Refuse new logins and close live ones on a transport
transport.reset Yes Discard the stored secret, keeping the account ID
message.send Yes Send message (text or file)
message.forward Yes Forward a text or file message as an independent copy
message.edit Yes Edit own text message, or as an owner or admin one that speaks as the conversation, using its revision
message.delete Yes Delete a message for self or all participants
message.react Yes Add or remove own reaction
message.play Yes Report somebody else's voice message played
delivery.set Yes Report a direct conversation's messages delivered through one
message.list Yes Get message history
message.search Yes Search visible messages globally or inside one conversation
message.clear Yes Clear history
read.set Yes Advance the conversation read cursor
pin.set Yes Pin a visible message
pin.remove Yes Remove a message pin
pin.list Yes List visible pinned messages
notification.set Yes Set personal conversation notification mode or mute
posting.set Yes Keep how the user chooses to post in a group or a channel
draft.update Yes Save or clear a private synchronized draft
reactions.see Yes Report the reactions to an own message seen
mentions.see Yes Report a message addressed to the user seen ahead of the read cursor
block.add Yes Block a user
block.remove Yes Remove a user block
block.list Yes List blocked users
privacy.get Yes Get account privacy settings
privacy.update Yes Update account privacy settings
ban.add Yes Ban and remove a group/channel member
ban.remove Yes Remove an active ban
ban.list Yes List active conversation bans
restriction.set Yes Set or clear a member posting restriction
sync.state Yes Where the account stream and every conversation stream stand
sync.pull Yes Pull a stream's events after a cursor
conversation.create Yes Create a group or channel
conversation.list Yes List conversations for the caller
conversation.search Yes Search the caller's direct, group and channel conversations
conversation.get Yes Get one conversation and computed capabilities
conversation.update Yes Update conversation metadata or slow mode
conversation.delete Yes Delete an owned conversation and its history
member.list Yes List conversation members
member.add Yes Add a member with a role
member.update Yes Change a role or transfer ownership
member.remove Yes Remove a member or leave
invite.create Yes Create an addressed or shareable invitation
invite.list Yes List invitations for a conversation
invite.get No See the conversation an invitation leads to
invite.accept Yes Join using an invitation token
invite.revoke Yes Revoke an invitation
invite.update Yes Choose or unchoose the primary link
contact.list Yes Get contact list
contact.add Yes Add contact
contact.rename Yes Rename contact
contact.delete Yes Delete contact
link.get Yes Get one's own link, made the first time
link.reset Yes Replace one's own link with a new one
link.open No See whose link it is
link.accept Yes Become contacts with whose link it is
phonebook.update Yes Upload changes of this device's address book
phonebook.get Yes Get the digest and size of this device's address book
phonebook.clear Yes Delete this device's address book
phonebook.match Yes Find which numbers of this device's address book belong to accounts
presence.get Yes Get presence status
presence.set Yes Hide or show yourself, and set a custom status
typing.set Yes Send typing start/stop signal
profile.get Yes Get user profile info
profile.update Yes Update own profile info
user.search Yes Search for users
file.create Yes Create or resume a stored multipart upload
file.get Yes Read stored upload state and uploaded parts
file.complete Yes Complete and verify a stored upload
file.abort Yes Abort an unattached stored upload
transfer.create Yes Offer an online-only direct file transfer
transfer.accept Yes Accept a direct transfer
transfer.decline Yes Decline a direct transfer
transfer.cancel Yes Cancel a direct transfer
call.create Yes Call the other person of a direct conversation
call.accept Yes Answer a call, and get its media
call.decline Yes Decline a call
call.hangup Yes Hang up, or cancel a call that rings
call.list Yes Page through the user's call records
button.press Yes Press a button under a bot's message
button.answer Yes A bot answers a press of its button
pack.list Yes List the catalog of smiley packs and the installed ones
pack.get Yes Get a smiley pack with its smileys
pack.install Yes Install a smiley pack in the panel
pack.remove Yes Remove a smiley pack from the panel
pack.order Yes Put the installed smiley packs in a new order
report.create Yes Report a message, a person or a conversation to the service's staff

Server → Client (Responses)

All responses include:

Server → Client (Push Events)

Type Description
connection.pong Ping response
connection.closing Server-initiated disconnect
session.revoked Persistent session was revoked, expired, replaced or banned; this connection is unauthenticated
code.updated A code this connection waits for got further or went another way; carries it as it is now
account.updated What the account may not do, or its file limits, changed; carries the whole standing
transport.updated A transport account of this user changed; carries the whole record
phone.updated The account's phone number changed; carries the whole record
qr.accepted A phone let this waiting client in; carries its tokens and session
message.created Message created or forwarded
message.edited Message content changed
message.deleted Message hidden for self or tombstoned for all
message.reacted Reaction aggregate changed
delivery.updated A participant's devices have a direct conversation's messages further
message.cleared Conversation hidden for this user
message.played A voice message became played as the user sees it
file.updated Stored media metadata or preview state changed
read.updated Conversation read cursor advanced
pin.added Message was pinned
pin.removed Message pin was removed
notification.updated Personal conversation notification settings changed
posting.updated How the user chooses to post in a conversation changed
draft.updated Personal conversation draft changed or was cleared
reactions.updated Reactions waiting for the user to see changed
mentions.updated A mention was reported seen ahead of the read cursor
read.reached Somebody else read further among the user's messages in a group or a channel
block.added A private user block was added
block.removed A private user block was removed
privacy.updated Private account privacy settings changed
ban.added A member was banned and removed
ban.removed A conversation ban was removed
restriction.updated A member posting restriction changed
conversation.created Conversation became available to the user
conversation.updated Conversation metadata changed
conversation.deleted Conversation is no longer the user's: deleted, left, removed, banned or deleted by the service
member.added Member joined or was added
member.updated Member role changed, or the member's nick or picture
member.removed Member left or was removed
invite.created Invitation was created
invite.accepted Invitation was used
invite.revoked Invitation was revoked
invite.updated Invitation became or stopped being the primary link
presence.online Contact came online
presence.offline Contact went offline
presence.updated Contact became active or not, changed their custom status, or moved on in the rough of their last seen
presence.self Another of your devices, or time, changed whether you hide or your custom status
contact.added Somebody became a contact: added on a device of yours, found in an address book, or answering a chat you started
contact.requested Somebody not among your contacts wrote to you and asks to be taken in
contact.renamed A contact was renamed
contact.deleted A contact or a request was taken out of your list
profile.updated Your profile, or the profile of somebody you list or have a direct conversation with, changed
typing.changed Contact started or stopped composing a message
transfer.created Direct transfer offered
transfer.accepted Direct transfer accepted
transfer.declined Direct transfer declined
transfer.cancelled Direct transfer cancelled or expired
call.incoming A call rings this client
call.accepted The callee answered; carries the caller's media
call.connected The relay hears both parties
call.ended The call ended, and why
button.pressed Somebody pressed a button of a bot's; told to the bot alone
pack.installed A smiley pack was installed in the panel
pack.removed A smiley pack was removed from the panel
pack.ordered The installed smiley packs were put in a new order
announcement.updated The service announced something to the client's platform, or changed it; carries it whole
announcement.removed An announcement was withdrawn before it ended, or is for the client's platform no longer

Push events have no id and no ok field. Durable events also carry their place in a stream: seq, with conversation_id for a conversation stream.