Skip to main content
A Branch is a private messaging space in Clody. Whether you want a one-on-one conversation or a group chat with several friends, a Branch keeps those messages visible only to its members. Because Clody requires participants to be friends before they can share a Branch, you always know exactly who is in the conversation.

What Is a Branch?

Every Branch belongs to one of two modes, determined at creation time by the ispm flag:
  • Direct message (DM)ispm: true. Exactly two participants: you and one friend. No additional members can be added later.
  • Group chatispm: false. You plus any number of friends. New friends can be invited after the Branch is created.
When you create a Branch, Clody automatically adds you as the owner. Every other person you list in members must already be on your friends list. If any member ID you supply is not a friend, the server returns 403 Forbidden.

Branch Lifecycle

1

Create the Branch

Send a POST /api/branch/create request with the IDs of the friends you want to include. For a group chat, you can optionally supply a name.
The server responds with the new Branch object and emits an added_branch Socket.IO event to every member.
2

Add More Members (group chats only)

Any current member can invite additional friends using POST /api/branch/add_member. The new member must be a friend of the person doing the inviting.
You cannot add members to a DM Branch (ispm: true).
3

Chat

Send messages with POST /api/bm/create. Messages can contain up to 5 000 characters and up to 10 file attachments. See the Messaging guide for the full message workflow.
4

Rename the Branch

Any member can rename the group with POST /api/branch/rename. Pass name: null to clear the name.
5

Leave or Kick

  • Non-owners leave with POST /api/branch/leave. The remaining members receive a left_branch event.
  • The owner can remove any non-owner with POST /api/branch/kick. The removed member receives a kicked_from_branch event.
The Branch owner cannot leave. If you own a Branch, you must either keep it or kick all other members before it becomes idle.

Message Features

Permissions

Real-Time Events

Clody pushes Branch activity to all members over Socket.IO. You receive these events on the default / namespace. See Real-Time Events for connection details.
Subscribe to added_branch on first connect so your UI can display new Branches without a full page refresh.